rse 97/08/01 02:36:44
Modified: htdocs/manual/mod mod_rewrite.html src mod_rewrite.c Log: Let the user use ``RewriteCond %{...} !=""'' instead of ``RewriteCond %{...} !^$'' which is ugly and has bad performance. Submitted by: Ralf S. Engelschall Reviewed by: Dean Gaudet, Ralf S. Engelschall Revision Changes Path 1.14 +2 -0 apache/htdocs/manual/mod/mod_rewrite.html Index: mod_rewrite.html =================================================================== RCS file: /export/home/cvs/apache/htdocs/manual/mod/mod_rewrite.html,v retrieving revision 1.13 retrieving revision 1.14 diff -u -r1.13 -r1.14 --- mod_rewrite.html 1997/07/31 21:23:11 1.13 +++ mod_rewrite.html 1997/08/01 09:36:41 1.14 @@ -632,6 +632,8 @@ lexicographically to <i>TestString</i> and results in a true expression if <i>TestString</i> is lexicographically equal to <i>CondPattern</i>, i.e the two strings are exactly equal (character by character). +If <i>CondPattern<I> is just <samp>""</samp> (two quotation marks) this +compares <i>TestString</i> against the empty string. <p> <li>'<b>-d</b>' (is <b>d</b>irectory)<br> Treats the <i>TestString</i> as a pathname and 1.45 +4 -1 apache/src/mod_rewrite.c Index: mod_rewrite.c =================================================================== RCS file: /export/home/cvs/apache/src/mod_rewrite.c,v retrieving revision 1.44 retrieving revision 1.45 diff -u -r1.44 -r1.45 --- mod_rewrite.c 1997/07/29 15:17:55 1.44 +++ mod_rewrite.c 1997/08/01 09:36:42 1.45 @@ -1784,7 +1784,10 @@ rc = (compare_lexicography(input, p->pattern+1) == -1 ? 1 : 0); } else if (strlen(p->pattern) > 1 && *(p->pattern) == '=') { - rc = (strcmp(input, p->pattern+1) == 0 ? 1 : 0); + if (strcmp(p->pattern+1, "\"\"") == 0) + rc = (*input == '\0'); + else + rc = (strcmp(input, p->pattern+1) == 0 ? 1 : 0); } else { /* it is really a regexp pattern, so apply it */