Hello community,

here is the log from the commit of package mpd for openSUSE:Factory checked in 
at 2019-10-17 12:22:15
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/mpd (Old)
 and      /work/SRC/openSUSE:Factory/.mpd.new.2352 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "mpd"

Thu Oct 17 12:22:15 2019 rev:13 rq:738869 version:0.21.16

Changes:
--------
--- /work/SRC/openSUSE:Factory/mpd/mpd.changes  2019-10-14 14:54:33.621971108 
+0200
+++ /work/SRC/openSUSE:Factory/.mpd.new.2352/mpd.changes        2019-10-17 
12:22:27.919145792 +0200
@@ -1,0 +2,15 @@
+Wed Oct 16 11:36:22 UTC 2019 - Илья Индиго <i...@ilya.pp.ua>
+
+- Update to 0.21.16
+  * https://raw.githubusercontent.com/MusicPlayerDaemon/MPD/v0.21.16/NEWS
+  * fix build with iconv() instead of ICU
+  * queue
+    * fix relative destination offset when moving a range
+  * storage
+    * curl: request the "resourcetype" property to fix database update
+    * curl: URL-encode more paths
+    * curl: follow redirects for collections without trailing slash
+  * update
+    * fix crash when music_directory is not a directory
+
+-------------------------------------------------------------------

Old:
----
  mpd-0.21.15.tar.xz

New:
----
  mpd-0.21.16.tar.xz

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ mpd.spec ++++++
--- /var/tmp/diff_new_pack.nLSZ2E/_old  2019-10-17 12:22:28.587144117 +0200
+++ /var/tmp/diff_new_pack.nLSZ2E/_new  2019-10-17 12:22:28.591144107 +0200
@@ -20,7 +20,7 @@
 %bcond_with    faad
 %bcond_without mpd_iso9660
 Name:           mpd
-Version:        0.21.15
+Version:        0.21.16
 Release:        0
 Summary:        Music Player Daemon
 License:        GPL-2.0-or-later

++++++ mpd-0.21.15.tar.xz -> mpd-0.21.16.tar.xz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/mpd-0.21.15/NEWS new/mpd-0.21.16/NEWS
--- old/mpd-0.21.15/NEWS        2019-09-25 21:24:15.000000000 +0200
+++ new/mpd-0.21.16/NEWS        2019-10-16 11:58:36.000000000 +0200
@@ -1,3 +1,14 @@
+ver 0.21.16 (2019/10/16)
+* queue
+  - fix relative destination offset when moving a range
+* storage
+  - curl: request the "resourcetype" property to fix database update
+  - curl: URL-encode more paths
+  - curl: follow redirects for collections without trailing slash
+* update
+  - fix crash when music_directory is not a directory
+* fix build with iconv() instead of ICU
+
 ver 0.21.15 (2019/09/25)
 * decoder
   - dsdiff, dsf: fix displayed bit rate
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/mpd-0.21.15/android/AndroidManifest.xml 
new/mpd-0.21.16/android/AndroidManifest.xml
--- old/mpd-0.21.15/android/AndroidManifest.xml 2019-09-25 21:24:15.000000000 
+0200
+++ new/mpd-0.21.16/android/AndroidManifest.xml 2019-10-16 11:58:36.000000000 
+0200
@@ -2,8 +2,8 @@
 <manifest xmlns:android="http://schemas.android.com/apk/res/android";
           package="org.musicpd"
           android:installLocation="auto"
-          android:versionCode="38"
-          android:versionName="0.21.15">
+          android:versionCode="39"
+          android:versionName="0.21.16">
 
   <uses-sdk android:minSdkVersion="21" android:targetSdkVersion="26"/>
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/mpd-0.21.15/doc/conf.py new/mpd-0.21.16/doc/conf.py
--- old/mpd-0.21.15/doc/conf.py 2019-09-25 21:24:15.000000000 +0200
+++ new/mpd-0.21.16/doc/conf.py 2019-10-16 11:58:36.000000000 +0200
@@ -38,7 +38,7 @@
 # built documents.
 #
 # The short X.Y version.
-version = '0.21.15'
+version = '0.21.16'
 # The full version, including alpha/beta/rc tags.
 release = version
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/mpd-0.21.15/meson.build new/mpd-0.21.16/meson.build
--- old/mpd-0.21.15/meson.build 2019-09-25 21:24:15.000000000 +0200
+++ new/mpd-0.21.16/meson.build 2019-10-16 11:58:36.000000000 +0200
@@ -1,7 +1,7 @@
 project(
   'mpd',
   ['c', 'cpp'],
-  version: '0.21.15',
+  version: '0.21.16',
   meson_version: '>= 0.49.0',
   default_options: [
     'c_std=c99',
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/mpd-0.21.15/src/db/update/Walk.cxx 
new/mpd-0.21.16/src/db/update/Walk.cxx
--- old/mpd-0.21.15/src/db/update/Walk.cxx      2019-09-25 21:24:15.000000000 
+0200
+++ new/mpd-0.21.16/src/db/update/Walk.cxx      2019-10-16 11:58:36.000000000 
+0200
@@ -493,6 +493,12 @@
                if (!GetInfo(storage, "", info))
                        return false;
 
+               if (!info.IsDirectory()) {
+                       FormatError(update_domain, "Not a directory: %s",
+                                   storage.MapUTF8("").c_str());
+                       return false;
+               }
+
                ExcludeList exclude_list;
 
                UpdateDirectory(root, exclude_list, info);
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/mpd-0.21.15/src/lib/curl/Easy.hxx 
new/mpd-0.21.16/src/lib/curl/Easy.hxx
--- old/mpd-0.21.15/src/lib/curl/Easy.hxx       2019-09-25 21:24:15.000000000 
+0200
+++ new/mpd-0.21.16/src/lib/curl/Easy.hxx       2019-10-16 11:58:36.000000000 
+0200
@@ -30,6 +30,8 @@
 #ifndef CURL_EASY_HXX
 #define CURL_EASY_HXX
 
+#include "String.hxx"
+
 #include <curl/curl.h>
 
 #include <utility>
@@ -88,8 +90,8 @@
                        throw std::runtime_error(curl_easy_strerror(code));
        }
 
-       char *Escape(const char *string, int length=0) const noexcept {
-               return curl_easy_escape(handle, string, length);
+       CurlString Escape(const char *string, int length=0) const noexcept {
+               return CurlString(curl_easy_escape(handle, string, length));
        }
 };
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/mpd-0.21.15/src/lib/curl/Escape.cxx 
new/mpd-0.21.16/src/lib/curl/Escape.cxx
--- old/mpd-0.21.15/src/lib/curl/Escape.cxx     1970-01-01 01:00:00.000000000 
+0100
+++ new/mpd-0.21.16/src/lib/curl/Escape.cxx     2019-10-16 11:58:36.000000000 
+0200
@@ -0,0 +1,71 @@
+/*
+ * Copyright (C) 2018 Max Kellermann <max.kellerm...@gmail.com>
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * - Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * - Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the
+ * distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE
+ * FOUNDATION OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "Escape.hxx"
+#include "Easy.hxx"
+#include "String.hxx"
+#include "util/IterableSplitString.hxx"
+
+std::string
+CurlEscapeUriPath(CURL *curl, StringView src) noexcept
+{
+       std::string dest;
+
+       for (const auto i : IterableSplitString(src, '/')) {
+               CurlString escaped(curl_easy_escape(curl, i.data, i.size));
+               if (!dest.empty())
+                       dest.push_back('/');
+               dest += escaped.c_str();
+       }
+
+       return dest;
+}
+
+std::string
+CurlEscapeUriPath(StringView src) noexcept
+{
+       CurlEasy easy;
+       return CurlEscapeUriPath(easy.Get(), src);
+}
+
+std::string
+CurlUnescape(CURL *curl, StringView src) noexcept
+{
+       int outlength;
+       CurlString tmp(curl_easy_unescape(curl, src.data, src.size,
+                                         &outlength));
+       return std::string(tmp.c_str(), outlength);
+}
+
+std::string
+CurlUnescape(StringView src) noexcept
+{
+       CurlEasy easy;
+       return CurlUnescape(easy.Get(), src);
+}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/mpd-0.21.15/src/lib/curl/Escape.hxx 
new/mpd-0.21.16/src/lib/curl/Escape.hxx
--- old/mpd-0.21.15/src/lib/curl/Escape.hxx     1970-01-01 01:00:00.000000000 
+0100
+++ new/mpd-0.21.16/src/lib/curl/Escape.hxx     2019-10-16 11:58:36.000000000 
+0200
@@ -0,0 +1,51 @@
+/*
+ * Copyright (C) 2018 Max Kellermann <max.kellerm...@gmail.com>
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * - Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * - Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the
+ * distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE
+ * FOUNDATION OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef CURL_ESCAPE_HXX
+#define CURL_ESCAPE_HXX
+
+#include <curl/curl.h>
+
+#include <string>
+
+struct StringView;
+
+std::string
+CurlEscapeUriPath(CURL *curl, StringView src) noexcept;
+
+std::string
+CurlEscapeUriPath(StringView src) noexcept;
+
+std::string
+CurlUnescape(CURL *curl, StringView src) noexcept;
+
+std::string
+CurlUnescape(StringView src) noexcept;
+
+#endif
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/mpd-0.21.15/src/lib/curl/Form.cxx 
new/mpd-0.21.16/src/lib/curl/Form.cxx
--- old/mpd-0.21.15/src/lib/curl/Form.cxx       2019-09-25 21:24:15.000000000 
+0200
+++ new/mpd-0.21.16/src/lib/curl/Form.cxx       2019-10-16 11:58:36.000000000 
+0200
@@ -28,6 +28,7 @@
  */
 
 #include "Form.hxx"
+#include "String.hxx"
 
 std::string
 EncodeForm(CURL *curl,
@@ -43,12 +44,10 @@
                result.push_back('=');
 
                if (!i.second.empty()) {
-                       char *value = curl_easy_escape(curl, i.second.data(),
-                                                      i.second.length());
-                       if (value != nullptr) {
+                       CurlString value(curl_easy_escape(curl, i.second.data(),
+                                                         i.second.length()));
+                       if (value)
                                result.append(value);
-                               curl_free(value);
-                       }
                }
        }
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/mpd-0.21.15/src/lib/curl/String.hxx 
new/mpd-0.21.16/src/lib/curl/String.hxx
--- old/mpd-0.21.15/src/lib/curl/String.hxx     1970-01-01 01:00:00.000000000 
+0100
+++ new/mpd-0.21.16/src/lib/curl/String.hxx     2019-10-16 11:58:36.000000000 
+0200
@@ -0,0 +1,77 @@
+/*
+ * Copyright 2019 Max Kellermann <max.kellerm...@gmail.com>
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * - Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * - Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the
+ * distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE
+ * FOUNDATION OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef CURL_STRING_HXX
+#define CURL_STRING_HXX
+
+#include <curl/curl.h>
+
+#include <utility>
+
+/**
+ * An OO wrapper for an allocated string to be freed with curl_free().
+ */
+class CurlString {
+       char *p = nullptr;
+
+public:
+       CurlString() noexcept = default;
+       CurlString(std::nullptr_t) noexcept {}
+
+       explicit CurlString(char *_p) noexcept
+               :p(_p) {}
+
+       CurlString(CurlString &&src) noexcept
+               :p(std::exchange(src.p, nullptr)) {}
+
+       ~CurlString() noexcept {
+               if (p != nullptr)
+                       curl_free(p);
+       }
+
+       CurlString &operator=(CurlString &&src) noexcept {
+               using std::swap;
+               swap(p, src.p);
+               return *this;
+       }
+
+       operator bool() const noexcept {
+               return p != nullptr;
+       }
+
+       operator const char *() const noexcept {
+               return p;
+       }
+
+       const char *c_str() const noexcept {
+               return p;
+       }
+};
+
+#endif
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/mpd-0.21.15/src/lib/curl/meson.build 
new/mpd-0.21.16/src/lib/curl/meson.build
--- old/mpd-0.21.15/src/lib/curl/meson.build    2019-09-25 21:24:15.000000000 
+0200
+++ new/mpd-0.21.16/src/lib/curl/meson.build    2019-10-16 11:58:36.000000000 
+0200
@@ -11,6 +11,7 @@
   'Init.cxx',
   'Global.cxx',
   'Request.cxx',
+  'Escape.cxx',
   'Form.cxx',
   include_directories: inc,
   dependencies: [
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/mpd-0.21.15/src/lib/icu/meson.build 
new/mpd-0.21.16/src/lib/icu/meson.build
--- old/mpd-0.21.15/src/lib/icu/meson.build     2019-09-25 21:24:15.000000000 
+0200
+++ new/mpd-0.21.16/src/lib/icu/meson.build     2019-10-16 11:58:36.000000000 
+0200
@@ -20,7 +20,7 @@
 elif not get_option('iconv').disabled()
   have_iconv = compiler.has_function('iconv')
   conf.set('HAVE_ICONV', have_iconv)
-  if get_option('iconv').enabled()
+  if not have_iconv and get_option('iconv').enabled()
     error('iconv() not available')
   endif
 endif
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/mpd-0.21.15/src/queue/PlaylistEdit.cxx 
new/mpd-0.21.16/src/queue/PlaylistEdit.cxx
--- old/mpd-0.21.15/src/queue/PlaylistEdit.cxx  2019-09-25 21:24:15.000000000 
+0200
+++ new/mpd-0.21.16/src/queue/PlaylistEdit.cxx  2019-10-16 11:58:36.000000000 
+0200
@@ -353,7 +353,7 @@
                        return;
                to = (currentSong + abs(to)) % GetLength();
                if (start < (unsigned)to)
-                       to--;
+                       to -= end - start;
        }
 
        queue.MoveRange(start, end, to);
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/mpd-0.21.15/src/storage/plugins/CurlStorage.cxx 
new/mpd-0.21.16/src/storage/plugins/CurlStorage.cxx
--- old/mpd-0.21.15/src/storage/plugins/CurlStorage.cxx 2019-09-25 
21:24:15.000000000 +0200
+++ new/mpd-0.21.16/src/storage/plugins/CurlStorage.cxx 2019-10-16 
11:58:36.000000000 +0200
@@ -25,8 +25,10 @@
 #include "lib/curl/Init.hxx"
 #include "lib/curl/Global.hxx"
 #include "lib/curl/Slist.hxx"
+#include "lib/curl/String.hxx"
 #include "lib/curl/Request.hxx"
 #include "lib/curl/Handler.hxx"
+#include "lib/curl/Escape.hxx"
 #include "lib/expat/ExpatParser.hxx"
 #include "fs/Traits.hxx"
 #include "event/Call.hxx"
@@ -35,7 +37,6 @@
 #include "thread/Cond.hxx"
 #include "util/ASCII.hxx"
 #include "util/ChronoUtil.hxx"
-#include "util/IterableSplitString.hxx"
 #include "util/RuntimeError.hxx"
 #include "util/StringCompare.hxx"
 #include "util/StringFormat.hxx"
@@ -77,26 +78,15 @@
        if (StringIsEmpty(uri_utf8))
                return base;
 
-       CurlEasy easy;
-       std::string path_esc;
-
-       for (auto elt: IterableSplitString(uri_utf8, '/')) {
-               char *elt_esc = easy.Escape(elt.data, elt.size);
-               if (!path_esc.empty())
-                       path_esc.push_back('/');
-               path_esc += elt_esc;
-               curl_free(elt_esc);
-       }
-
+       std::string path_esc = CurlEscapeUriPath(uri_utf8);
        return PathTraitsUTF8::Build(base.c_str(), path_esc.c_str());
 }
 
 const char *
 CurlStorage::MapToRelativeUTF8(const char *uri_utf8) const noexcept
 {
-       // TODO: escape/unescape?
-
-       return PathTraitsUTF8::Relative(base.c_str(), uri_utf8);
+       return PathTraitsUTF8::Relative(base.c_str(),
+                                       CurlUnescape(uri_utf8).c_str());
 }
 
 class BlockingHttpRequest : protected CurlResponseHandler {
@@ -132,6 +122,10 @@
                        std::rethrow_exception(postponed_error);
        }
 
+       CURL *GetEasy() noexcept {
+               return request.Get();
+       }
+
 protected:
        void SetDone() {
                assert(!done);
@@ -269,6 +263,8 @@
                 CommonExpatParser(ExpatNamespaceSeparator{'|'})
        {
                request.SetOption(CURLOPT_CUSTOMREQUEST, "PROPFIND");
+               request.SetOption(CURLOPT_FOLLOWLOCATION, 1l);
+               request.SetOption(CURLOPT_MAXREDIRS, 1l);
 
                request_headers.Append(StringFormat<40>("depth: %u", depth));
 
@@ -277,6 +273,7 @@
                request.SetOption(CURLOPT_POSTFIELDS,
                                  "<?xml version=\"1.0\"?>\n"
                                  "<a:propfind xmlns:a=\"DAV:\">"
+                                 "<a:prop><a:resourcetype/></a:prop>"
                                  "<a:prop><a:getcontenttype/></a:prop>"
                                  "<a:prop><a:getcontentlength/></a:prop>"
                                  "</a:propfind>");
@@ -284,6 +281,7 @@
                // TODO: send request body
        }
 
+       using BlockingHttpRequest::GetEasy;
        using BlockingHttpRequest::Wait;
 
 protected:
@@ -454,9 +452,7 @@
 {
        // TODO: escape the given URI
 
-       std::string uri = base;
-       uri += uri_utf8;
-
+       const auto uri = MapUTF8(uri_utf8);
        return HttpGetInfoOperation(*curl, uri.c_str()).Perform();
 }
 
@@ -503,7 +499,11 @@
                if (path == nullptr)
                        return nullptr;
 
-               path = StringAfterPrefix(path, base_path.c_str());
+               /* kludge: ignoring case in this comparison to avoid
+                  false negatives if the web server uses a different
+                  case in hex digits in escaped characters; TODO:
+                  implement properly */
+               path = StringAfterPrefixIgnoreCase(path, base_path.c_str());
                if (path == nullptr || *path == 0)
                        return nullptr;
 
@@ -529,10 +529,7 @@
                if (escaped_name.IsNull())
                        return;
 
-               // TODO: unescape
-               const auto name = escaped_name;
-
-               entries.emplace_front(std::string(name.data, name.size));
+               entries.emplace_front(CurlUnescape(GetEasy(), escaped_name));
 
                auto &info = entries.front().info;
                info = StorageFileInfo(r.collection
@@ -546,10 +543,7 @@
 std::unique_ptr<StorageDirectoryReader>
 CurlStorage::OpenDirectory(const char *uri_utf8)
 {
-       // TODO: escape the given URI
-
-       std::string uri = base;
-       uri += uri_utf8;
+       std::string uri = MapUTF8(uri_utf8);
 
        /* collection URIs must end with a slash */
        if (uri.back() != '/')


Reply via email to