[libsoup/wip/tpopela/negotiate: 50/64] soup-auth-negotiate: Correctly handle the protection space for subdirectories of root dir



commit 00093e9a5fc338ef76adb83025077db3ef5f9866
Author: Tomas Popela <tpopela redhat com>
Date:   Sat Feb 6 15:53:14 2016 +0100

    soup-auth-negotiate: Correctly handle the protection space for subdirectories of root dir
    
    Fix the https://bugzilla.gnome.org/show_bug.cgi?id=755617 for soup-auth-negotiate
    as it applies here as well.

 libsoup/soup-auth-negotiate.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)
---
diff --git a/libsoup/soup-auth-negotiate.c b/libsoup/soup-auth-negotiate.c
index 100a46b..fe95a4f 100644
--- a/libsoup/soup-auth-negotiate.c
+++ b/libsoup/soup-auth-negotiate.c
@@ -164,7 +164,9 @@ soup_auth_negotiate_get_protection_space (SoupAuth *auth, SoupURI *source_uri)
 
        /* Strip filename component */
        p = strrchr (space, '/');
-       if (p && p != space && p[1])
+       if (p && p == space && p[1])
+               p[1] = '\0';
+       else if (p && p[1])
                *p = '\0';
 
        return g_slist_prepend (NULL, space);


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