diff options
author | Max Kellermann <max@duempel.org> | 2013-09-12 10:21:37 +0200 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2013-09-12 10:49:57 +0200 |
commit | 1c65908cdb1559d7dc7ebbf93d2e1eb9b94197e0 (patch) | |
tree | b254f7ebd76ecb3d66421ce17f5fd0632a895284 /src/ConfigPath.cxx | |
parent | 3aaf013dd126321b2bca6d4cda26c50fff0a342f (diff) | |
download | mpd-1c65908cdb1559d7dc7ebbf93d2e1eb9b94197e0.tar.gz mpd-1c65908cdb1559d7dc7ebbf93d2e1eb9b94197e0.tar.xz mpd-1c65908cdb1559d7dc7ebbf93d2e1eb9b94197e0.zip |
ConfigPath: simplify the duplicate tilde check
Diffstat (limited to '')
-rw-r--r-- | src/ConfigPath.cxx | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/ConfigPath.cxx b/src/ConfigPath.cxx index 9fd3876bf..6bc56b897 100644 --- a/src/ConfigPath.cxx +++ b/src/ConfigPath.cxx @@ -87,11 +87,7 @@ ParsePath(const char *path, Error &error) return Path::Null(); #ifndef WIN32 - if (!g_path_is_absolute(path) && path[0] != '~') { - error.Format(path_domain, - "not an absolute path: %s", path); - return Path::Null(); - } else if (path[0] == '~') { + if (path[0] == '~') { Path home = Path::Null(); if (path[1] == '/' || path[1] == '\0') { @@ -116,6 +112,10 @@ ParsePath(const char *path, Error &error) return Path::Null(); return Path::Build(home, path2); + } else if (!g_path_is_absolute(path)) { + error.Format(path_domain, + "not an absolute path: %s", path); + return Path::Null(); } else { #endif return path2; |