diff options
author | Bruce Momjian <bruce@momjian.us> | 1999-07-19 16:46:53 +0000 |
---|---|---|
committer | Bruce Momjian <bruce@momjian.us> | 1999-07-19 16:46:53 +0000 |
commit | 2b8c9e793db33e3378c61d71f76852264282d2fb (patch) | |
tree | 5bad3aa97063bd4f9cd3ebec393e3e7bcc157a77 | |
parent | be1851902ab73a3f2599c2a5c8cdf7da8d0800e0 (diff) | |
download | postgresql-2b8c9e793db33e3378c61d71f76852264282d2fb.tar.gz postgresql-2b8c9e793db33e3378c61d71f76852264282d2fb.zip |
Set the application name, used for parsing readline's .inputrc -- dz
Massimo
-rw-r--r-- | src/bin/psql/psql.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/bin/psql/psql.c b/src/bin/psql/psql.c index c7aaf83f987..d788b183200 100644 --- a/src/bin/psql/psql.c +++ b/src/bin/psql/psql.c @@ -7,7 +7,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/bin/psql/Attic/psql.c,v 1.184 1999/07/19 02:27:10 momjian Exp $ + * $Header: /cvsroot/pgsql/src/bin/psql/Attic/psql.c,v 1.185 1999/07/19 16:46:53 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -2876,6 +2876,13 @@ main(int argc, char **argv) pqsignal(SIGINT, handle_sigint); /* control-C => cancel */ #ifdef USE_READLINE settings.useReadline = 1; + { + /* + * Set the application name, used for parsing .inputrc -- dz + */ + char *progname = strrchr(argv[0], SEP_CHAR); + rl_readline_name = (progname ? progname+1 : argv[0]); + } #endif } #ifdef PSQL_ALWAYS_GET_PASSWORDS |