Commit 53aafdb9 authored by Tom Lane's avatar Tom Lane

Strip file names reported in error messages on Windows, too.

Commit dd136052 established a policy that error message FILE items
should include only the base name of the reporting source file, for
uniformity and succinctness.  We now observe that some Windows compilers
use backslashes in __FILE__ strings, so truncate at backslashes as well.

This is expected to fix some platform variation in the results of the
new libpq_pipeline test module.

Discussion: https://postgr.es/m/3650140.1617372290@sss.pgh.pa.us
parent 1877c9ac
......@@ -529,6 +529,10 @@ errfinish(const char *filename, int lineno, const char *funcname)
slash = strrchr(filename, '/');
if (slash)
filename = slash + 1;
/* Some Windows compilers use backslashes in __FILE__ strings */
slash = strrchr(filename, '\\');
if (slash)
filename = slash + 1;
}
edata->filename = filename;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment