From: Amos Jeffries Date: Wed, 13 Jul 2011 09:28:43 +0000 (-0600) Subject: Bug 2495: ignore whitespace prefix on config lines X-Git-Tag: SQUID_3_1_15~41 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=49a40de9f9b7783d86fbc4734bd7ae710f11732b;p=thirdparty%2Fsquid.git Bug 2495: ignore whitespace prefix on config lines Allow whitespace indentation before any lines. Making SMP and comment configuration easier to read for some. --- diff --git a/src/cache_cf.cc b/src/cache_cf.cc index 153a115fab..ca0eb2320a 100644 --- a/src/cache_cf.cc +++ b/src/cache_cf.cc @@ -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;