mirror of
https://git.postgresql.org/git/postgresql.git
synced 2024-12-15 08:20:16 +08:00
Tweak previous patch to ensure edata->filename always gets initialized.
On a platform that isn't supplying __FILE__, previous coding would either crash or give a stale result for the filename string. Not sure how likely that is, but the original code catered for it, so let's keep doing so.
This commit is contained in:
parent
75b6183694
commit
b06c6f52d0
@ -341,8 +341,10 @@ errstart(int elevel, const char *filename, int lineno,
|
||||
|
||||
/* keep only base name, useful especially for vpath builds */
|
||||
slash = strrchr(filename, '/');
|
||||
edata->filename = slash ? slash + 1 : filename;
|
||||
if (slash)
|
||||
filename = slash + 1;
|
||||
}
|
||||
edata->filename = filename;
|
||||
edata->lineno = lineno;
|
||||
edata->funcname = funcname;
|
||||
/* the default text domain is the backend's */
|
||||
@ -1116,8 +1118,10 @@ elog_start(const char *filename, int lineno, const char *funcname)
|
||||
|
||||
/* keep only base name, useful especially for vpath builds */
|
||||
slash = strrchr(filename, '/');
|
||||
edata->filename = slash ? slash + 1 : filename;
|
||||
if (slash)
|
||||
filename = slash + 1;
|
||||
}
|
||||
edata->filename = filename;
|
||||
edata->lineno = lineno;
|
||||
edata->funcname = funcname;
|
||||
/* errno is saved now so that error parameter eval can't change it */
|
||||
|
Loading…
Reference in New Issue
Block a user