mirror of
https://gitlab.com/Theopse/fbi-i18n-zh.git
synced 2025-04-06 03:58:02 +08:00
Correct logic for adding slashes to directory paths.
This commit is contained in:
parent
70fe88d04c
commit
0c0e04aad6
@ -33,7 +33,7 @@ Result task_create_file_item(list_item** out, FS_Archive archive, const char* pa
|
||||
item->color = COLOR_DIRECTORY;
|
||||
|
||||
size_t len = strlen(path);
|
||||
if(len > 1 && path[len - 1] != '/') {
|
||||
if(len == 0 || path[len - 1] != '/') {
|
||||
snprintf(fileInfo->path, FILE_PATH_MAX, "%s/", path);
|
||||
} else {
|
||||
strncpy(fileInfo->path, path, FILE_PATH_MAX);
|
||||
|
Loading…
x
Reference in New Issue
Block a user