You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by Rodent of Unusual Size <Ke...@Golux.Com> on 1998/08/04 18:24:00 UTC

[PATCH] remove whitespace compression from ap_cfg_getline

As Dean pointed out back in July (in message ID
<Pi...@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';