summaryrefslogtreecommitdiff
path: root/src/bin/psql/startup.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/bin/psql/startup.c')
-rw-r--r--src/bin/psql/startup.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/bin/psql/startup.c b/src/bin/psql/startup.c
index 106199273f0..d5f1c0d4088 100644
--- a/src/bin/psql/startup.c
+++ b/src/bin/psql/startup.c
@@ -603,7 +603,12 @@ process_psqlrc(char *argv0)
char etc_path[MAXPGPATH];
char *envrc = getenv("PSQLRC");
- find_my_exec(argv0, my_exec_path);
+ if (find_my_exec(argv0, my_exec_path) < 0)
+ {
+ fprintf(stderr, _("%s: could not find own program executable\n"), argv0);
+ exit(EXIT_FAILURE);
+ }
+
get_etc_path(my_exec_path, etc_path);
snprintf(rc_file, MAXPGPATH, "%s/%s", etc_path, SYSPSQLRC);