1.1 --- a/libe2access/lib/src/utils.c Fri Feb 18 00:14:05 2022 +0100
1.2 +++ b/libe2access/lib/src/utils.c Sat Feb 19 00:43:46 2022 +0100
1.3 @@ -33,14 +33,21 @@
1.4
1.5 errcode_t utils_list_dir(ext2_filsys fs, const char *path)
1.6 {
1.7 + char _path[strlen(path + 1)];
1.8 struct utils_list_dir_data data;
1.9
1.10 + /* Copy the path for splitting. */
1.11 +
1.12 + strcpy(_path, path);
1.13 +
1.14 + /* Initialise the directory listing state. */
1.15 +
1.16 data.fs = fs;
1.17
1.18 /* Select a specific object, if appropriate. */
1.19
1.20 if (!image_isdir_by_path(fs, path))
1.21 - data.filename = path_basename(path);
1.22 + data.filename = path_split(_path);
1.23 else
1.24 data.filename = NULL;
1.25
1.26 @@ -48,7 +55,7 @@
1.27
1.28 data.link_count = 0;
1.29
1.30 - return image_list_dir(fs, path, utils_list_dir_proc, &data);
1.31 + return image_list_dir(fs, _path, utils_list_dir_proc, &data);
1.32 }
1.33
1.34 /* Show directory entries when iterating. */