Commit 7d392f25 authored by Peter Eisentraut's avatar Peter Eisentraut

Fixed psql -c "\slashcmd"

parent f4d452c1
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
* *
* Copyright 2000 by PostgreSQL Global Development Group * 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 "postgres.h"
#include "command.h" #include "command.h"
...@@ -149,11 +149,13 @@ HandleSlashCmds(const char *line, ...@@ -149,11 +149,13 @@ HandleSlashCmds(const char *line,
if (continue_parse && *continue_parse && *(continue_parse + 1) == '\\') if (continue_parse && *continue_parse && *(continue_parse + 1) == '\\')
continue_parse += 2; continue_parse += 2;
if (end_of_cmd)
{
if (continue_parse) if (continue_parse)
*end_of_cmd = line + (continue_parse - my_line); *end_of_cmd = line + (continue_parse - my_line);
else else
*end_of_cmd = line + strlen(line); *end_of_cmd = line + strlen(line);
}
free(my_line); free(my_line);
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
* *
* Copyright 2000 by PostgreSQL Global Development Group * Copyright 2000 by PostgreSQL Global Development Group
* *
* $Header: /cvsroot/pgsql/src/bin/psql/startup.c,v 1.27 2000/03/01 21:09:58 petere Exp $ * $Header: /cvsroot/pgsql/src/bin/psql/startup.c,v 1.28 2000/03/18 22:48:29 petere Exp $
*/ */
#include "postgres.h" #include "postgres.h"
...@@ -357,7 +357,10 @@ parse_psql_options(int argc, char *argv[], struct adhoc_opts * options) ...@@ -357,7 +357,10 @@ parse_psql_options(int argc, char *argv[], struct adhoc_opts * options)
case 'c': case 'c':
options->action_string = optarg; options->action_string = optarg;
if (optarg[0] == '\\') if (optarg[0] == '\\')
{
options->action = ACT_SINGLE_SLASH; options->action = ACT_SINGLE_SLASH;
options->action_string++;
}
else else
options->action = ACT_SINGLE_QUERY; options->action = ACT_SINGLE_QUERY;
break; break;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment