diff options
author | Bastien Montagne <montagne29@wanadoo.fr> | 2015-01-26 18:58:02 +0300 |
---|---|---|
committer | Bastien Montagne <montagne29@wanadoo.fr> | 2015-01-26 18:59:24 +0300 |
commit | 7bc6fbf158556331e247b714f874b919b9af9ae7 (patch) | |
tree | c5b3c883d6a4243f2f11bbac9306abdee07e1207 /source/blender/blenlib/intern/fileops.c | |
parent | fca515838e70f8bec7028b840bb921a1be9fabbb (diff) |
Cleanup: current/parent paths: add helpers in BLI_path_utils.
Also, avoid calling ugly strcmp with '.' or '..', making direct char checks is
much cheaper here!
Diffstat (limited to 'source/blender/blenlib/intern/fileops.c')
-rw-r--r-- | source/blender/blenlib/intern/fileops.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/source/blender/blenlib/intern/fileops.c b/source/blender/blenlib/intern/fileops.c index 8ae99c0da97..d6fe5e52b95 100644 --- a/source/blender/blenlib/intern/fileops.c +++ b/source/blender/blenlib/intern/fileops.c @@ -316,7 +316,7 @@ static bool delete_recursive(const char *dir) 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)) { @@ -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 (STREQ(dirent->d_name, ".") || STREQ(dirent->d_name, "..")) + if (FILENAME_IS_CURRPAR(dirent->d_name)) continue; join_dirfile_alloc(&from_path, &from_alloc_len, from, dirent->d_name); |