fs/Path: add separator constants/functions

This commit is contained in:
Max Kellermann
2013-10-14 22:26:23 +02:00
parent 62271bf6ce
commit 47d655ea7f
4 changed files with 54 additions and 21 deletions

View File

@@ -306,7 +306,7 @@ skip_symlink(const Directory *directory, const char *utf8_name)
const char *p = target_str;
while (*p == '.') {
if (p[1] == '.' && G_IS_DIR_SEPARATOR(p[2])) {
if (p[1] == '.' && Path::IsSeparatorFS(p[2])) {
/* "../" moves to parent directory */
directory = directory->parent;
if (directory == NULL) {
@@ -316,7 +316,7 @@ skip_symlink(const Directory *directory, const char *utf8_name)
return !follow_outside_symlinks;
}
p += 3;
} else if (G_IS_DIR_SEPARATOR(p[1]))
} else if (Path::IsSeparatorFS(p[1]))
/* eliminate "./" */
p += 2;
else