diff options
author | Bruce Momjian <bruce@momjian.us> | 1997-05-24 01:45:17 +0000 |
---|---|---|
committer | Bruce Momjian <bruce@momjian.us> | 1997-05-24 01:45:17 +0000 |
commit | 656d88c6112411720161e5deef79372adb78c7b4 (patch) | |
tree | 81d27796b41d1bcfe81b317e7382e46eebef5566 /src/bin/psql/psql.c | |
parent | ac534bee0116cfeec8cf49e35119cdfc8942c984 (diff) | |
download | postgresql-656d88c6112411720161e5deef79372adb78c7b4.tar.gz postgresql-656d88c6112411720161e5deef79372adb78c7b4.zip |
Fix \c option after breaking it.
Diffstat (limited to 'src/bin/psql/psql.c')
-rw-r--r-- | src/bin/psql/psql.c | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/src/bin/psql/psql.c b/src/bin/psql/psql.c index 7fa71a3b98a..aa60a311f61 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.64 1997/05/23 01:53:42 momjian Exp $ + * $Header: /cvsroot/pgsql/src/bin/psql/Attic/psql.c,v 1.65 1997/05/24 01:45:17 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -1128,8 +1128,20 @@ HandleSlashCmds(PsqlSettings * settings, } do_connect(optarg2, optarg3, settings); } - else - do_connect(optarg, optarg2, settings); + else { + char *optarg3; + int blank_loc2; + + blank_loc2 = strcspn(optarg, " \t"); + if (blank_loc2 == 0 || *(optarg + blank_loc2) == '\0') + optarg3 = NULL; + else { + optarg3 = optarg + blank_loc2 + + strspn(optarg + blank_loc2, " \t"); + *(optarg + blank_loc2) = '\0'; + } + do_connect(optarg, optarg3, settings); + } } break; case 'd': /* \d describe tables or columns in a table */ |