diff options
Diffstat (limited to 'source/blender/blenlib/intern/fileops.c')
-rw-r--r-- | source/blender/blenlib/intern/fileops.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/source/blender/blenlib/intern/fileops.c b/source/blender/blenlib/intern/fileops.c index f6bbd3273f9..d6fe5e52b95 100644 --- a/source/blender/blenlib/intern/fileops.c +++ b/source/blender/blenlib/intern/fileops.c @@ -311,12 +311,12 @@ static bool delete_recursive(const char *dir) bool err = false; unsigned int nbr, i; - i = nbr = BLI_dir_contents(dir, &filelist); + i = nbr = BLI_filelist_dir_contents(dir, &filelist); fl = filelist; while (i--) { char file[8]; BLI_split_file_part(fl->path, file, sizeof(file)); - if (STREQ(file, ".") || STREQ(file, "..")) { + if (FILENAME_IS_CURRPAR(file)) { /* Skip! */ } else if (S_ISDIR(fl->type)) { @@ -336,7 +336,7 @@ static bool delete_recursive(const char *dir) err = true; } - BLI_free_filelist(filelist, nbr); + BLI_filelist_free(filelist, nbr, NULL); return err; } @@ -584,7 +584,7 @@ static int recursive_operation(const char *startfrom, const char *startto, for (i = 0; i < n; i++) { const struct dirent * const dirent = dirlist[i]; - if (!strcmp(dirent->d_name, ".") || !strcmp(dirent->d_name, "..")) + if (FILENAME_IS_CURRPAR(dirent->d_name)) continue; join_dirfile_alloc(&from_path, &from_alloc_len, from, dirent->d_name); @@ -896,7 +896,7 @@ int BLI_move(const char *file, const char *to) } #endif -static char *check_destination(const char *file, const char *to) +static const char *check_destination(const char *file, const char *to) { struct stat st; @@ -927,18 +927,18 @@ static char *check_destination(const char *file, const char *to) } } - return (char *)to; + return to; } int BLI_copy(const char *file, const char *to) { - char *actual_to = check_destination(file, to); + const char *actual_to = check_destination(file, to); int ret; ret = recursive_operation(file, actual_to, copy_callback_pre, copy_single_file, NULL); if (actual_to != to) - MEM_freeN(actual_to); + MEM_freeN((void *)actual_to); return ret; } |