Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit7d392f2

Browse files
committed
Fixed psql -c "\slashcmd"
1 parentf4d452c commit7d392f2

File tree

2 files changed

+12
-7
lines changed

2 files changed

+12
-7
lines changed

‎src/bin/psql/command.c

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
*
44
* Copyright 2000 by PostgreSQL Global Development Group
55
*
6-
* $Header: /cvsroot/pgsql/src/bin/psql/command.c,v 1.24 2000/03/01 21:09:58 petere Exp $
6+
* $Header: /cvsroot/pgsql/src/bin/psql/command.c,v 1.25 2000/03/18 22:48:29 petere Exp $
77
*/
88
#include"postgres.h"
99
#include"command.h"
@@ -149,11 +149,13 @@ HandleSlashCmds(const char *line,
149149
if (continue_parse&&*continue_parse&&*(continue_parse+1)=='\\')
150150
continue_parse+=2;
151151

152-
153-
if (continue_parse)
154-
*end_of_cmd=line+ (continue_parse-my_line);
155-
else
156-
*end_of_cmd=line+strlen(line);
152+
if (end_of_cmd)
153+
{
154+
if (continue_parse)
155+
*end_of_cmd=line+ (continue_parse-my_line);
156+
else
157+
*end_of_cmd=line+strlen(line);
158+
}
157159

158160
free(my_line);
159161

‎src/bin/psql/startup.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
*
44
* Copyright 2000 by PostgreSQL Global Development Group
55
*
6-
* $Header: /cvsroot/pgsql/src/bin/psql/startup.c,v 1.27 2000/03/01 21:09:58 petere Exp $
6+
* $Header: /cvsroot/pgsql/src/bin/psql/startup.c,v 1.28 2000/03/18 22:48:29 petere Exp $
77
*/
88
#include"postgres.h"
99

@@ -357,7 +357,10 @@ parse_psql_options(int argc, char *argv[], struct adhoc_opts * options)
357357
case'c':
358358
options->action_string=optarg;
359359
if (optarg[0]=='\\')
360+
{
360361
options->action=ACT_SINGLE_SLASH;
362+
options->action_string++;
363+
}
361364
else
362365
options->action=ACT_SINGLE_QUERY;
363366
break;

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp