Skip to content

Commit 656d88c

Browse files
committed
Fix \c option after breaking it.
1 parent ac534be commit 656d88c

File tree

1 file changed

+15
-3
lines changed

1 file changed

+15
-3
lines changed

src/bin/psql/psql.c

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*
88
*
99
* IDENTIFICATION
10-
* $Header: /cvsroot/pgsql/src/bin/psql/Attic/psql.c,v 1.64 1997/05/23 01:53:42 momjian Exp $
10+
* $Header: /cvsroot/pgsql/src/bin/psql/Attic/psql.c,v 1.65 1997/05/24 01:45:17 momjian Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
@@ -1128,8 +1128,20 @@ HandleSlashCmds(PsqlSettings * settings,
11281128
}
11291129
do_connect(optarg2, optarg3, settings);
11301130
}
1131-
else
1132-
do_connect(optarg, optarg2, settings);
1131+
else {
1132+
char *optarg3;
1133+
int blank_loc2;
1134+
1135+
blank_loc2 = strcspn(optarg, " \t");
1136+
if (blank_loc2 == 0 || *(optarg + blank_loc2) == '\0')
1137+
optarg3 = NULL;
1138+
else {
1139+
optarg3 = optarg + blank_loc2 +
1140+
strspn(optarg + blank_loc2, " \t");
1141+
*(optarg + blank_loc2) = '\0';
1142+
}
1143+
do_connect(optarg, optarg3, settings);
1144+
}
11331145
}
11341146
break;
11351147
case 'd': /* \d describe tables or columns in a table */

0 commit comments

Comments
 (0)