From: Amos Jeffries Date: Tue, 7 May 2013 09:17:00 +0000 (-0600) Subject: Polish: show file path on Bungled lines X-Git-Tag: SQUID_3_3_5~17 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=0d4461484bd2009fc92be44a608892dbdedb9863;p=thirdparty%2Fsquid.git Polish: show file path on Bungled lines Since include directive was added it is entirely possible that two files are loaded from the same filename on different paths. This also enables automated tools to make use of the displayed filename to manipulate the relevant file. --- diff --git a/src/cache_cf.cc b/src/cache_cf.cc index ca774bf54d..598de58dc0 100644 --- a/src/cache_cf.cc +++ b/src/cache_cf.cc @@ -300,14 +300,10 @@ update_maxobjsize(void) static void SetConfigFilename(char const *file_name, bool is_pipe) { - cfg_filename = file_name; - - char const *token; - if (is_pipe) cfg_filename = file_name + 1; - else if ((token = strrchr(cfg_filename, '/'))) - cfg_filename = token + 1; + else + cfg_filename = file_name; } static const char* @@ -528,7 +524,7 @@ parseOneConfigFile(const char *file_name, unsigned int depth) if ((token = strchr(new_file_name, '"'))) *token = '\0'; - cfg_filename = new_file_name; + SetConfigFilename(new_file_name, false); } config_lineno = new_lineno; @@ -598,7 +594,7 @@ parseOneConfigFile(const char *file_name, unsigned int depth) fclose(fp); } - cfg_filename = orig_cfg_filename; + SetConfigFilename(orig_cfg_filename, false); config_lineno = orig_config_lineno; xfree(tmp_line);