[gvfs] dav: Fix DAV implementation stripping spaces



commit ad6c120c5b7a100460e893b59b35413fd18bc528
Author: Colin Leroy <colin colino net>
Date:   Fri Jul 21 13:32:31 2017 +0200

    dav: Fix DAV implementation stripping spaces
    
    This patch fixes DAV stripping leading and trailing spaces from server
    responses. This fixes access to DAV files and directories which names start or
    end with a space.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=785123

 daemon/gvfsbackendhttp.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/daemon/gvfsbackendhttp.c b/daemon/gvfsbackendhttp.c
index 6023add..81ebe27 100644
--- a/daemon/gvfsbackendhttp.c
+++ b/daemon/gvfsbackendhttp.c
@@ -100,7 +100,7 @@ http_path_get_basename (const char *path)
     return NULL;
 
   /* remove any leading slashes */
-  while (*path != '\0' && (*path == '/' || *path == ' '))
+  while (*path != '\0' && *path == '/')
     path++;
 
   len = strlen (path);
@@ -111,7 +111,7 @@ http_path_get_basename (const char *path)
   while (len)
     {
       char c = path[len - 1];
-      if (!g_ascii_isspace (c) && c != '/')
+      if (c != '/')
        break;
 
       len--;


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]