projects
/
postgresql.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
16a3415
)
pg_dump: Fix weird error message composition
author
Peter Eisentraut
<
[email protected]
>
Thu, 20 Jun 2024 09:36:38 +0000
(11:36 +0200)
committer
Peter Eisentraut
<
[email protected]
>
Thu, 20 Jun 2024 09:36:38 +0000
(11:36 +0200)
The previous way could make it look like "stdin" was the actual input
file name. Write it as two separate messages instead.
src/bin/pg_dump/filter.c
patch
|
blob
|
blame
|
history
diff --git
a/src/bin/pg_dump/filter.c
b/src/bin/pg_dump/filter.c
index 3fb93c5f155f1d39aaeadf403a90dc12475101ed..5815cd237483f5968663e9db0bc25ae867db6060 100644
(file)
--- a/
src/bin/pg_dump/filter.c
+++ b/
src/bin/pg_dump/filter.c
@@
-161,10
+161,12
@@
pg_log_filter_error(FilterStateData *fstate, const char *fmt,...)
vsnprintf(buf, sizeof(buf), fmt, argp);
va_end(argp);
- pg_log_error("invalid format in filter read from \"%s\" on line %d: %s",
- (fstate->fp == stdin ? "stdin" : fstate->filename),
- fstate->lineno,
- buf);
+ if (fstate->fp == stdin)
+ pg_log_error("invalid format in filter read from standard input on line %d: %s",
+ fstate->lineno, buf);
+ else
+ pg_log_error("invalid format in filter read from file \"%s\" on line %d: %s",
+ fstate->filename, fstate->lineno, buf);
}
/*