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

Commit75b6183

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 parentd16ebde commit75b6183

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
@@ -335,7 +335,14 @@ errstart(int elevel, const char *filename, int lineno,
335335
edata->elevel=elevel;
336336
edata->output_to_server=output_to_server;
337337
edata->output_to_client=output_to_client;
338-
edata->filename=filename;
338+
if (filename)
339+
{
340+
constchar*slash;
341+
342+
/* keep only base name, useful especially for vpath builds */
343+
slash=strrchr(filename,'/');
344+
edata->filename=slash ?slash+1 :filename;
345+
}
339346
edata->lineno=lineno;
340347
edata->funcname=funcname;
341348
/* the default text domain is the backend's */
@@ -1103,7 +1110,14 @@ elog_start(const char *filename, int lineno, const char *funcname)
11031110
}
11041111

11051112
edata=&errordata[errordata_stack_depth];
1106-
edata->filename=filename;
1113+
if (filename)
1114+
{
1115+
constchar*slash;
1116+
1117+
/* keep only base name, useful especially for vpath builds */
1118+
slash=strrchr(filename,'/');
1119+
edata->filename=slash ?slash+1 :filename;
1120+
}
11071121
edata->lineno=lineno;
11081122
edata->funcname=funcname;
11091123
/* errno is saved now so that error parameter eval can't change it */

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp