Author: jmb
Date: Fri Jan 30 21:03:50 2009
New Revision: 6317
URL:
http://source.netsurf-browser.org?rev=6317&view=rev
Log:
Let's try that again. Now actually passes the regression tests.
Modified:
trunk/netsurf/content/urldb.c
Modified: trunk/netsurf/content/urldb.c
URL:
http://source.netsurf-browser.org/trunk/netsurf/content/urldb.c?rev=6317&...
==============================================================================
--- trunk/netsurf/content/urldb.c (original)
+++ trunk/netsurf/content/urldb.c Fri Jan 30 21:03:50 2009
@@ -1905,17 +1905,13 @@
const char *slash;
assert(parent != NULL);
+ assert(parent->segment == NULL);
assert(path[0] == '/');
- /* Skip past leading / */
- path++;
- /* And start with children, as parent has no segment */
+ /* Start with children, as parent has no segment */
p = parent->children;
while (p != NULL) {
- if (*path == '\0')
- return (struct path_data *) p;
-
slash = strchr(path + 1, '/');
if (!slash)
slash = path + strlen(path);
@@ -1923,6 +1919,11 @@
if (strncmp(p->segment, path + 1, slash - path - 1) == 0 &&
strcmp(p->scheme, scheme) == 0 &&
p->port == port) {
+ if (*slash == '\0') {
+ /* Complete match */
+ return (struct path_data *) p;
+ }
+
/* Match so far, go down tree */
p = p->children;