uxn

Varvara Ordinator, written in ANSI C(SDL2)
git clone https://git.eamoncaddigan.net/uxn.git
Log | Files | Refs | README | LICENSE

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:
Msrc/devices/file.c | 7++++++-
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