mirror of
https://gitlab.com/Theopse/fbi-i18n-zh.git
synced 2025-05-11 10:38:58 +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;
|
item->color = COLOR_DIRECTORY;
|
||||||
|
|
||||||
size_t len = strlen(path);
|
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);
|
snprintf(fileInfo->path, FILE_PATH_MAX, "%s/", path);
|
||||||
} else {
|
} else {
|
||||||
strncpy(fileInfo->path, path, FILE_PATH_MAX);
|
strncpy(fileInfo->path, path, FILE_PATH_MAX);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user