Return-Path: Delivered-To: apmail-httpd-cvs-archive@httpd.apache.org Received: (qmail 23882 invoked by uid 500); 22 Apr 2003 19:00:14 -0000 Mailing-List: contact cvs-help@httpd.apache.org; run by ezmlm Precedence: bulk Reply-To: dev@httpd.apache.org list-help: list-unsubscribe: list-post: Delivered-To: mailing list cvs@httpd.apache.org Received: (qmail 23855 invoked by uid 500); 22 Apr 2003 19:00:13 -0000 Delivered-To: apmail-httpd-2.0-cvs@apache.org Date: 22 Apr 2003 19:00:05 -0000 Message-ID: <20030422190005.58998.qmail@icarus.apache.org> From: nd@apache.org To: httpd-2.0-cvs@apache.org Subject: cvs commit: httpd-2.0/modules/generators mod_autoindex.c X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N nd 2003/04/22 12:00:03 Modified: . Tag: APACHE_2_0_BRANCH CHANGES STATUS modules/generators Tag: APACHE_2_0_BRANCH mod_autoindex.c Log: emit and accept modern query string parameter delimiters (;). Thus column headers no longer contain unescaped ampersands. PR: 10880 Reviewed by: Will Rowe, Jeff Trawick Revision Changes Path No revision No revision 1.988.2.83 +4 -0 httpd-2.0/CHANGES Index: CHANGES =================================================================== RCS file: /home/cvs/httpd-2.0/CHANGES,v retrieving revision 1.988.2.82 retrieving revision 1.988.2.83 diff -u -r1.988.2.82 -r1.988.2.83 --- CHANGES 17 Apr 2003 20:26:32 -0000 1.988.2.82 +++ CHANGES 22 Apr 2003 18:59:59 -0000 1.988.2.83 @@ -1,5 +1,9 @@ Changes with Apache 2.0.46 + *) mod_autoindex now emits and accepts modern query string parameter + delimiters (;). Thus column headers no longer contain unescaped + ampersands. PR 10880 [Andr� Malo] + *) Enable ap_sock_disable_nagle for Windows. This along with the addition of APR_TCP_NODELAY_INHERITED to apr.hw will cause Nagle to be disabled for Windows. [Allan Edwards] 1.751.2.228 +1 -7 httpd-2.0/STATUS Index: STATUS =================================================================== RCS file: /home/cvs/httpd-2.0/STATUS,v retrieving revision 1.751.2.227 retrieving revision 1.751.2.228 diff -u -r1.751.2.227 -r1.751.2.228 --- STATUS 19 Apr 2003 11:34:33 -0000 1.751.2.227 +++ STATUS 22 Apr 2003 19:00:00 -0000 1.751.2.228 @@ -143,12 +143,6 @@ +1: nd, trawick (this is simple... look how query string is appended in the other situation) - * mod_autoindex emits and accepts modern query string parameter - delimiters (;). Thus column headers no longer contain unescaped - ampersands. PR 10880 - modules/generators/mod_autoindex.c: r1.117 - +1: nd, wrowe, trawick - * Unescape the supplied wildcard pattern in mod_autoindex. Otherwise the pattern will not always match as desired. PR 12596. modules/generators/mod_autoindex.c: r1.119 No revision No revision 1.112.2.5 +27 -22 httpd-2.0/modules/generators/mod_autoindex.c Index: mod_autoindex.c =================================================================== RCS file: /home/cvs/httpd-2.0/modules/generators/mod_autoindex.c,v retrieving revision 1.112.2.4 retrieving revision 1.112.2.5 diff -u -r1.112.2.4 -r1.112.2.5 --- mod_autoindex.c 7 Mar 2003 20:43:49 -0000 1.112.2.4 +++ mod_autoindex.c 22 Apr 2003 19:00:02 -0000 1.112.2.5 @@ -1458,24 +1458,20 @@ char curkey, char curdirection, const char *colargs, int nosort) { - char qvalue[13]; - int reverse; - if (!nosort) { - reverse = ((curkey == column) && (curdirection == D_ASCENDING)); + char qvalue[9]; + qvalue[0] = '?'; qvalue[1] = 'C'; qvalue[2] = '='; qvalue[3] = column; - qvalue[4] = '&'; - qvalue[5] = 'a'; - qvalue[6] = 'm'; - qvalue[7] = 'p'; - qvalue[8] = ';'; - qvalue[9] = 'O'; - qvalue[10] = '='; - qvalue[11] = reverse ? D_DESCENDING : D_ASCENDING; - qvalue[12] = '\0'; + qvalue[4] = ';'; + qvalue[5] = 'O'; + qvalue[6] = '='; + /* reverse? */ + qvalue[7] = ((curkey == column) && (curdirection == D_ASCENDING)) + ? D_DESCENDING : D_ASCENDING; + qvalue[8] = '\0'; ap_rvputs(r, "", anchor, "", NULL); } @@ -2011,20 +2007,23 @@ while (qstring && *qstring) { if (qstring[0] == 'C' && qstring[1] == '=' && qstring[2] && strchr(K_VALID, qstring[2]) - && (qstring[3] == '&' || !qstring[3])) { + && (qstring[3] == '&' || qstring[3] == ';' + || !qstring[3])) { keyid = qstring[2]; qstring += qstring[3] ? 4 : 3; } else if (qstring[0] == 'O' && qstring[1] == '=' && ((qstring[2] == D_ASCENDING) || (qstring[2] == D_DESCENDING)) - && (qstring[3] == '&' || !qstring[3])) { + && (qstring[3] == '&' || qstring[3] == ';' + || !qstring[3])) { direction = qstring[2]; qstring += qstring[3] ? 4 : 3; } else if (qstring[0] == 'F' && qstring[1] == '=' && qstring[2] && strchr("012", qstring[2]) - && (qstring[3] == '&' || !qstring[3])) { + && (qstring[3] == '&' || qstring[3] == ';' + || !qstring[3])) { if (qstring[2] == '0') { autoindex_opts &= ~(FANCY_INDEXING | TABLE_INDEXING); } @@ -2035,26 +2034,32 @@ else if (qstring[2] == '2') { autoindex_opts |= FANCY_INDEXING | TABLE_INDEXING; } - strcpy(fval, "&F= "); + strcpy(fval, ";F= "); fval[3] = qstring[2]; qstring += qstring[3] ? 4 : 3; } else if (qstring[0] == 'V' && qstring[1] == '=' && (qstring[2] == '0' || qstring[2] == '1') - && (qstring[3] == '&' || !qstring[3])) { + && (qstring[3] == '&' || qstring[3] == ';' + || !qstring[3])) { if (qstring[2] == '0') { autoindex_opts &= ~VERSION_SORT; } else if (qstring[2] == '1') { autoindex_opts |= VERSION_SORT; } - strcpy(vval, "&V= "); + strcpy(vval, ";V= "); vval[3] = qstring[2]; qstring += qstring[3] ? 4 : 3; } else if (qstring[0] == 'P' && qstring[1] == '=') { - const char *eos = ap_strchr_c(qstring, '&'); - if (eos) { + const char *eos = qstring + 2; + + while (*eos && *eos != '&' && *eos != ';') { + ++eos; + } + + if (*eos) { pstring = apr_pstrndup(r->pool, qstring + 2, eos - qstring - 2); qstring = eos + 1; @@ -2064,7 +2069,7 @@ qstring = NULL; } if (*pstring) { - ppre = "&P="; + ppre = ";P="; } else { pstring = NULL;