Fix crash when a relative URL contains "//../".

svn path=/trunk/netsurf/; revision=2543
This commit is contained in:
James Bursa 2006-04-22 09:07:28 +00:00
parent 79946e43c9
commit 77907dd584

View File

@ -47,7 +47,7 @@ void url_init(void)
"(#([^[:space:]]*))?"
"[[:space:]]*$", REG_EXTENDED);
regcomp_wrapper(&url_up_re,
"/([^/]|[.][^./]|[^./][.]|[^./][^./]|[^/][^/][^/]+)?"
"/([^/]?|[.][^./]|[^./][.]|[^./][^./]|[^/][^/][^/]+)"
"/[.][.](/|$)",
REG_EXTENDED);
}
@ -863,15 +863,15 @@ int main(int argc, char *argv[])
printf("<== '%s'\n", s);
free(s);
}*/
/* if (1 != i) {
if (1 != i) {
res = url_join(argv[i], argv[1], &s);
if (res == URL_FUNC_OK) {
printf("'%s' + '%s' \t= '%s'\n", argv[1],
argv[i], s);
free(s);
}
}*/
printf("'%s' => ", argv[i]);
}
/* printf("'%s' => ", argv[i]);
res = url_nice(argv[i], &s, true);
if (res == URL_FUNC_OK) {
printf("'%s', ", s);
@ -886,7 +886,7 @@ int main(int argc, char *argv[])
} else {
printf("failed %u, ", res);
}
printf("\n");
printf("\n");*/
}
return 0;
}