fixed href comparison bug

Fri, 02 Oct 2015 14:42:47 +0200

author
Olaf Wintermann <olaf.wintermann@gmail.com>
date
Fri, 02 Oct 2015 14:42:47 +0200
changeset 141
b0c44be83276
parent 140
0a06bed068a1
child 142
0c0ccb7f71ba

fixed href comparison bug

libidav/methods.c file | annotate | diff | comparison | revisions
--- a/libidav/methods.c	Fri Oct 02 13:29:32 2015 +0200
+++ b/libidav/methods.c	Fri Oct 02 14:42:47 2015 +0200
@@ -365,7 +365,14 @@
                 ret = 1;
             }
         }
-    }
+    } else if(href_r.length == href_s.length + 1) {
+        if(href_r.ptr[href_r.length-1] == '/') {
+            href_r.length--;
+            if(!sstrcmp(href_s, href_r)) {
+                ret = 1;
+            }
+        }
+    } 
 
     free(href_s.ptr);
     free(href_r.ptr);

mercurial