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:
authorCampbell Barton <ideasman42@gmail.com>2020-03-06 16:58:48 +0300
committerCampbell Barton <ideasman42@gmail.com>2020-03-06 17:02:37 +0300
commita5bbdd6998abc5b0a780880c0ff4e1aa9df77b74 (patch)
treeedebab603fc8a037ce9ed585b284db067a381bcd /source/blender/blenlib/intern/storage.c
parentb4f1edd98b96d379c196786a75d05a4decac2d5e (diff)
Cleanup: use ELEM macro for path slash checks
Diffstat (limited to 'source/blender/blenlib/intern/storage.c')
-rw-r--r--source/blender/blenlib/intern/storage.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/source/blender/blenlib/intern/storage.c b/source/blender/blenlib/intern/storage.c
index e267c061b2b..7743ced1344 100644
--- a/source/blender/blenlib/intern/storage.c
+++ b/source/blender/blenlib/intern/storage.c
@@ -115,7 +115,7 @@ double BLI_dir_free_space(const char *dir)
tmp[0] = '\\';
tmp[1] = 0; /* Just a failsafe */
- if (dir[0] == '/' || dir[0] == '\\') {
+ if (ELEM(dir[0] == '/', '\\')) {
tmp[0] = '\\';
tmp[1] = 0;
}
@@ -277,7 +277,7 @@ int BLI_exists(const char *name)
len = wcslen(tmp_16);
/* in Windows #stat doesn't recognize dir ending on a slash
* so we remove it here */
- if (len > 3 && (tmp_16[len - 1] == L'\\' || tmp_16[len - 1] == L'/')) {
+ if ((len > 3) && ELEM(tmp_16[len - 1], L'\\', L'/')) {
tmp_16[len - 1] = '\0';
}
/* two special cases where the trailing slash is needed: