From 7108ed08f291dac9f317a2f723cf281eadb2564e Mon Sep 17 00:00:00 2001 From: Fabian Keil Date: Thu, 10 Apr 2008 04:17:56 +0000 Subject: [PATCH] In url_match(), check the right member for NULL when determining whether there's a path regex to execute. Looking for a plain-text representation works as well, but it looks "interesting" and that member will be removed soonish anyway. --- urlmatch.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/urlmatch.c b/urlmatch.c index 1c4963a2..257ee969 100644 --- a/urlmatch.c +++ b/urlmatch.c @@ -1,4 +1,4 @@ -const char urlmatch_rcs[] = "$Id: urlmatch.c,v 1.27 2008/04/08 15:44:33 fabiankeil Exp $"; +const char urlmatch_rcs[] = "$Id: urlmatch.c,v 1.28 2008/04/08 16:07:39 fabiankeil Exp $"; /********************************************************************* * * File : $Source: /cvsroot/ijbswa/current/urlmatch.c,v $ @@ -33,6 +33,10 @@ const char urlmatch_rcs[] = "$Id: urlmatch.c,v 1.27 2008/04/08 15:44:33 fabianke * * Revisions : * $Log: urlmatch.c,v $ + * Revision 1.28 2008/04/08 16:07:39 fabiankeil + * Make it harder to mistake url_match()'s + * second parameter for an url_spec. + * * Revision 1.27 2008/04/08 15:44:33 fabiankeil * Save a bit of memory (and a few cpu cycles) by not bothering to * compile slash-only path regexes that don't affect the result. @@ -1135,7 +1139,7 @@ int url_match(const struct url_spec *pattern, #else #define DOMAIN_MATCHES ((NULL == pattern->dbuffer) || (0 == domain_match(pattern, http))) #endif -#define PATH_MATCHES ((NULL == pattern->path) || (0 == regexec(pattern->preg, http->path, 0, NULL, 0))) +#define PATH_MATCHES ((NULL == pattern->preg) || (0 == regexec(pattern->preg, http->path, 0, NULL, 0))) if (pattern->tag_regex != NULL) { -- 2.39.2