commit ea42a0bdd74ea59c729eeaeb3580cc13fab63f79
parent 3acaaa28743f3b8f3215f28feb1dda96d301d2c2
Author: Andrew Alderwick <andrew@alderwick.co.uk>
Date: Sun, 7 Nov 2021 00:46:18 +0000
Use basename for File/stat output
Diffstat:
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/src/devices/file.c b/src/devices/file.c
@@ -130,7 +130,12 @@ file_write(void *src, Uint16 len, Uint8 flags)
Uint16
file_stat(void *dest, Uint16 len)
{
- return get_entry(dest, len, current_filename, current_filename, 0);
+ char *basename = strrchr(current_filename, '/');
+ if(basename != NULL)
+ ++basename;
+ else
+ basename = current_filename;
+ return get_entry(dest, len, current_filename, basename, 0);
}
Uint16