diff options
Diffstat (limited to '')
-rw-r--r-- | src/directory.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/directory.c b/src/directory.c index 4c94e6be9..fb18ff91b 100644 --- a/src/directory.c +++ b/src/directory.c @@ -835,13 +835,21 @@ static Directory *findSubDirectory(Directory * directory, char *name) return NULL; } +int isRootDirectory(char *name) +{ + if (name == NULL || name[0] == '\0' || strcmp(name, "/") == 0) { + return 1; + } + return 0; +} + static Directory *getSubDirectory(Directory * directory, char *name, char **shortname) { Directory *subDirectory; int len; - if (name == NULL || name[0] == '\0' || strcmp(name, "/") == 0) { + if (isRootDirectory(name)) { return directory; } |