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

Commit1a44811

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 parente53724f commit1a44811

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
@@ -325,7 +325,14 @@ errstart(int elevel, const char *filename, int lineno,
325325
edata->elevel=elevel;
326326
edata->output_to_server=output_to_server;
327327
edata->output_to_client=output_to_client;
328-
edata->filename=filename;
328+
if (filename)
329+
{
330+
constchar*slash;
331+
332+
/* keep only base name, useful especially for vpath builds */
333+
slash=strrchr(filename,'/');
334+
edata->filename=slash ?slash+1 :filename;
335+
}
329336
edata->lineno=lineno;
330337
edata->funcname=funcname;
331338
/* Select default errcode based on elevel */
@@ -943,7 +950,14 @@ elog_start(const char *filename, int lineno, const char *funcname)
943950
}
944951

945952
edata=&errordata[errordata_stack_depth];
946-
edata->filename=filename;
953+
if (filename)
954+
{
955+
constchar*slash;
956+
957+
/* keep only base name, useful especially for vpath builds */
958+
slash=strrchr(filename,'/');
959+
edata->filename=slash ?slash+1 :filename;
960+
}
947961
edata->lineno=lineno;
948962
edata->funcname=funcname;
949963
/* errno is saved now so that error parameter eval can't change it */

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp