Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBastien Montagne <montagne29@wanadoo.fr>2015-01-26 18:58:02 +0300
committerBastien Montagne <montagne29@wanadoo.fr>2015-01-26 18:59:24 +0300
commit7bc6fbf158556331e247b714f874b919b9af9ae7 (patch)
treec5b3c883d6a4243f2f11bbac9306abdee07e1207 /source/blender/blenlib/intern/storage.c
parentfca515838e70f8bec7028b840bb921a1be9fabbb (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/storage.c')
-rw-r--r--source/blender/blenlib/intern/storage.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/source/blender/blenlib/intern/storage.c b/source/blender/blenlib/intern/storage.c
index 0d09b50a52c..38a15ab0a6d 100644
--- a/source/blender/blenlib/intern/storage.c
+++ b/source/blender/blenlib/intern/storage.c
@@ -135,10 +135,10 @@ static int bli_compare(struct direntry *entry1, struct direntry *entry2)
/* OK, now we know their S_IFMT fields are the same, go on to a name comparison */
/* make sure "." and ".." are always first */
- if (STREQ(entry1->relname, ".")) return (-1);
- if (STREQ(entry2->relname, ".")) return (1);
- if (STREQ(entry1->relname, "..")) return (-1);
- if (STREQ(entry2->relname, "..")) return (1);
+ if (FILENAME_IS_CURRENT(entry1->relname)) return (-1);
+ if (FILENAME_IS_CURRENT(entry2->relname)) return (1);
+ if (FILENAME_IS_PARENT(entry1->relname)) return (-1);
+ if (FILENAME_IS_PARENT(entry2->relname)) return (1);
return (BLI_natstrcmp(entry1->relname, entry2->relname));
}