Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitdd13605

Browse files
committed
Strip file names reported in error messages in vpath builds
In vpath builds, the __FILE__ macro that is used in verbose errorreports contains the full absolute file name, which makes the errormessages excessively verbose. So keep only the base name, thusmatching the behavior of non-vpath builds.
1 parentbe2f909 commitdd13605

File tree

1 file changed

+16
-2
lines changed

1 file changed

+16
-2
lines changed

‎src/backend/utils/error/elog.c

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -343,7 +343,14 @@ errstart(int elevel, const char *filename, int lineno,
343343
edata->elevel=elevel;
344344
edata->output_to_server=output_to_server;
345345
edata->output_to_client=output_to_client;
346-
edata->filename=filename;
346+
if (filename)
347+
{
348+
constchar*slash;
349+
350+
/* keep only base name, useful especially for vpath builds */
351+
slash=strrchr(filename,'/');
352+
edata->filename=slash ?slash+1 :filename;
353+
}
347354
edata->lineno=lineno;
348355
edata->funcname=funcname;
349356
/* the default text domain is the backend's */
@@ -1142,7 +1149,14 @@ elog_start(const char *filename, int lineno, const char *funcname)
11421149
}
11431150

11441151
edata=&errordata[errordata_stack_depth];
1145-
edata->filename=filename;
1152+
if (filename)
1153+
{
1154+
constchar*slash;
1155+
1156+
/* keep only base name, useful especially for vpath builds */
1157+
slash=strrchr(filename,'/');
1158+
edata->filename=slash ?slash+1 :filename;
1159+
}
11461160
edata->lineno=lineno;
11471161
edata->funcname=funcname;
11481162
/* errno is saved now so that error parameter eval can't change it */

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp