diff options
Diffstat (limited to 'src/storage/plugins/NfsStorage.cxx')
-rw-r--r-- | src/storage/plugins/NfsStorage.cxx | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/storage/plugins/NfsStorage.cxx b/src/storage/plugins/NfsStorage.cxx index 6ef6266aa..b2eec24ff 100644 --- a/src/storage/plugins/NfsStorage.cxx +++ b/src/storage/plugins/NfsStorage.cxx @@ -35,6 +35,7 @@ #include "event/Call.hxx" #include "event/DeferredMonitor.hxx" #include "event/TimeoutMonitor.hxx" +#include "util/ASCII.hxx" #include "util/StringCompare.hxx" extern "C" { @@ -401,11 +402,10 @@ NfsStorage::OpenDirectory(const char *uri_utf8) static Storage * CreateNfsStorageURI(EventLoop &event_loop, const char *base) { - if (strncmp(base, "nfs://", 6) != 0) + const char *p = StringAfterPrefixCaseASCII(base, "nfs://"); + if (p == nullptr) return nullptr; - const char *p = base + 6; - const char *mount = strchr(p, '/'); if (mount == nullptr) throw std::runtime_error("Malformed nfs:// URI"); |