]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Bug 2495: ignore whitespace prefix on config lines
authorAmos Jeffries <squid3@treenet.co.nz>
Wed, 13 Jul 2011 09:28:43 +0000 (03:28 -0600)
committerAmos Jeffries <squid3@treenet.co.nz>
Wed, 13 Jul 2011 09:28:43 +0000 (03:28 -0600)
Allow whitespace indentation before any lines. Making SMP and comment
configuration easier to read for some.

src/cache_cf.cc

index 153a115fabb687ab42b06e523d563ef4fd63dbf0..ca0eb2320a4f6f50e114384a229cf2b53c4d7ac4 100644 (file)
@@ -317,6 +317,11 @@ parseOneConfigFile(const char *file_name, unsigned int depth)
         if ((token = strchr(config_input_line, '\r')))
             *token = '\0';
 
+        // strip any prefix whitespace off the line.
+        const char *p = skip_ws(config_input_line);
+        if (config_input_line != p)
+            memmove(config_input_line, p, strlen(p)+1);
+
         if (strncmp(config_input_line, "#line ", 6) == 0) {
             static char new_file_name[1024];
             static char *file;