File tree 1 file changed +9
-5
lines changed 1 file changed +9
-5
lines changed Original file line number Diff line number Diff line change 3
3
*
4
4
* Copyright (c) 2000-2010, PostgreSQL Global Development Group
5
5
*
6
- * $PostgreSQL: pgsql/src/bin/psql/command.c,v 1.219 2010/05/08 16:39:51 tgl Exp $
6
+ * $PostgreSQL: pgsql/src/bin/psql/command.c,v 1.220 2010/05/21 17:37:44 rhaas Exp $
7
7
*/
8
8
#include "postgres_fe.h"
9
9
#include "command.h"
@@ -654,10 +654,14 @@ exec_command(const char *cmd,
654
654
size_t len ;
655
655
656
656
/* strip any trailing spaces and semicolons */
657
- len = strlen (opt );
658
- while (len > 0 &&
659
- (isspace ((unsigned char ) opt [len - 1 ]) || opt [len - 1 ] == ';' ))
660
- opt [-- len ] = '\0' ;
657
+ if (opt )
658
+ {
659
+ len = strlen (opt );
660
+ while (len > 0 &&
661
+ (isspace ((unsigned char ) opt [len - 1 ])
662
+ || opt [len - 1 ] == ';' ))
663
+ opt [-- len ] = '\0' ;
664
+ }
661
665
662
666
helpSQL (opt , pset .popt .topt .pager );
663
667
free (opt );
You can’t perform that action at this time.
0 commit comments