From: Amos Jeffries Date: Sun, 10 Jul 2011 21:42:02 +0000 (+1200) Subject: Bug 2495: ignore whitespace prefix on config lines X-Git-Tag: take08~55^2~77 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=f068973f3656df14321bdbc9a898ebd16ab8aa69;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 38c0e5e506..f67ea38da7 100644 --- a/src/cache_cf.cc +++ b/src/cache_cf.cc @@ -442,6 +442,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;