From: Amos Jeffries Date: Tue, 7 May 2013 08:35:57 +0000 (-0600) Subject: Polish: show file path on Bungled lines X-Git-Tag: SQUID_3_4_0_1~165 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=328a3f05fb862e7f742ba4c02f65b360b29aa171;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 75f54dfd12..9bc9b7212d 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);