|
|
@ -591,6 +591,7 @@ process_psqlrc(char *argv0) |
|
|
|
char rc_file[MAXPGPATH]; |
|
|
|
char rc_file[MAXPGPATH]; |
|
|
|
char my_exec_path[MAXPGPATH]; |
|
|
|
char my_exec_path[MAXPGPATH]; |
|
|
|
char etc_path[MAXPGPATH]; |
|
|
|
char etc_path[MAXPGPATH]; |
|
|
|
|
|
|
|
char *envrc; |
|
|
|
|
|
|
|
|
|
|
|
find_my_exec(argv0, my_exec_path); |
|
|
|
find_my_exec(argv0, my_exec_path); |
|
|
|
get_etc_path(my_exec_path, etc_path); |
|
|
|
get_etc_path(my_exec_path, etc_path); |
|
|
@ -598,7 +599,14 @@ process_psqlrc(char *argv0) |
|
|
|
snprintf(rc_file, MAXPGPATH, "%s/%s", etc_path, SYSPSQLRC); |
|
|
|
snprintf(rc_file, MAXPGPATH, "%s/%s", etc_path, SYSPSQLRC); |
|
|
|
process_psqlrc_file(rc_file); |
|
|
|
process_psqlrc_file(rc_file); |
|
|
|
|
|
|
|
|
|
|
|
if (get_home_path(home)) |
|
|
|
envrc = getenv("PSQLRC"); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (envrc != NULL && strlen(envrc) > 0) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
expand_tilde(&envrc); |
|
|
|
|
|
|
|
process_psqlrc_file(envrc); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
else if (get_home_path(home)) |
|
|
|
{ |
|
|
|
{ |
|
|
|
snprintf(rc_file, MAXPGPATH, "%s/%s", home, PSQLRC); |
|
|
|
snprintf(rc_file, MAXPGPATH, "%s/%s", home, PSQLRC); |
|
|
|
process_psqlrc_file(rc_file); |
|
|
|
process_psqlrc_file(rc_file); |
|
|
|