httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Rodent of Unusual Size <Ken.C...@Golux.Com>
Subject [PATCH] remove whitespace compression from ap_cfg_getline
Date Tue, 04 Aug 1998 16:24:00 GMT
As Dean pointed out back in July (in message ID
<Pine.LNX.3.96dg4.980708095219.2225E-100000@twinlark.arctic.org>),
ap_cfg_getline() not only trims leading and trailing whitespace, but
compresses it within the line.  This has caused me lots of woe in the
past.  Here's a patch to remove the compression part.  Anyone have
any problem with this before I commit it?

#ken	P-)}

Ken Coar                    <http://Web.Golux.Com/coar/>
Apache Group member         <http://www.apache.org/>
"Apache Server for Dummies" <http://Web.Golux.Com/coar/ASFD/>

--- util.c      1998/08/03 09:15:00     1.126
+++ util.c      1998/08/04 16:16:44
@@ -863,26 +863,14 @@
            break;
        }
 
-       /* Compress the line, reducing all blanks and tabs to one space.
+       /*
         * Leading and trailing white space is eliminated completely
         */
-       src = dst = buf;
+       src = buf;
        while (ap_isspace(*src))
            ++src;
-       while (*src != '\0')
-       {
-           /* Copy words */
-           while (!ap_isspace(*dst = *src) && *src != '\0') {
-               ++src;
-               ++dst;
-           }
-           if (*src == '\0') break;
-           *dst++ = ' ';
-           while (ap_isspace(*src))
-               ++src;
-       }
-       *dst = '\0';
        /* blast trailing whitespace */
+       dst = &src[strlen(src)];
        while (--dst >= buf && ap_isspace(*dst))
            *dst = '\0';

Mime
View raw message