From 63ad12bb89765253ba72a6ea830e061b0962b837 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Thu, 30 Jan 2025 17:35:12 +0100 Subject: [PATCH] storage/nfs: MapUTF8("") returns the full URL including parameters Closes https://github.com/MusicPlayerDaemon/MPD/issues/2154 --- src/storage/plugins/NfsStorage.cxx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/storage/plugins/NfsStorage.cxx b/src/storage/plugins/NfsStorage.cxx index 8d96bbbd9..27f72e02b 100644 --- a/src/storage/plugins/NfsStorage.cxx +++ b/src/storage/plugins/NfsStorage.cxx @@ -239,7 +239,11 @@ std::string NfsStorage::MapUTF8(std::string_view uri_utf8) const noexcept { if (uri_utf8.empty()) - return base; + /* this special case returns the original "nfs://" URI + with all parameters (they are missing in the "base" + variable); this is important because MapUTF8("") is + called for the state file */ + return url; return PathTraitsUTF8::Build(base, uri_utf8); }