Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 53aafdb

Browse files
committed
Strip file names reported in error messages on Windows, too.
Commit dd13605 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
1 parent 1877c9a commit 53aafdb

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/backend/utils/error/elog.c

+4
Original file line numberDiff line numberDiff line change
@@ -529,6 +529,10 @@ errfinish(const char *filename, int lineno, const char *funcname)
529529
slash = strrchr(filename, '/');
530530
if (slash)
531531
filename = slash + 1;
532+
/* Some Windows compilers use backslashes in __FILE__ strings */
533+
slash = strrchr(filename, '\\');
534+
if (slash)
535+
filename = slash + 1;
532536
}
533537

534538
edata->filename = filename;

0 commit comments

Comments
 (0)