summaryrefslogtreecommitdiff
path: root/src/bin/psql/command.c
diff options
context:
space:
mode:
authorPeter Eisentraut <peter_e@gmx.net>2000-03-18 22:48:29 +0000
committerPeter Eisentraut <peter_e@gmx.net>2000-03-18 22:48:29 +0000
commit7d392f257bb4d6099faf28f15c158a978a41f011 (patch)
treec6adecfad9dd69474075b513d15c403ebfc931e4 /src/bin/psql/command.c
parentf4d452c13c454b1160ffd86c669651cd20a4374e (diff)
Fixed psql -c "\slashcmd"
Diffstat (limited to 'src/bin/psql/command.c')
-rw-r--r--src/bin/psql/command.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/src/bin/psql/command.c b/src/bin/psql/command.c
index e515f1e151b..db250f02b6e 100644
--- a/src/bin/psql/command.c
+++ b/src/bin/psql/command.c
@@ -3,7 +3,7 @@
*
* Copyright 2000 by PostgreSQL Global Development Group
*
- * $Header: /cvsroot/pgsql/src/bin/psql/command.c,v 1.24 2000/03/01 21:09:58 petere Exp $
+ * $Header: /cvsroot/pgsql/src/bin/psql/command.c,v 1.25 2000/03/18 22:48:29 petere Exp $
*/
#include "postgres.h"
#include "command.h"
@@ -149,11 +149,13 @@ HandleSlashCmds(const char *line,
if (continue_parse && *continue_parse && *(continue_parse + 1) == '\\')
continue_parse += 2;
-
- if (continue_parse)
- *end_of_cmd = line + (continue_parse - my_line);
- else
- *end_of_cmd = line + strlen(line);
+ if (end_of_cmd)
+ {
+ if (continue_parse)
+ *end_of_cmd = line + (continue_parse - my_line);
+ else
+ *end_of_cmd = line + strlen(line);
+ }
free(my_line);