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

Commit7ba3774

Browse files
committed
Tests for COMSPEC in the right place and supply a reasonable shell
default on Win32.
1 parentd2f6c3e commit7ba3774

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

‎src/bin/psql/command.c

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
*
44
* Copyright (c) 2000-2004, PostgreSQL Global Development Group
55
*
6-
* $PostgreSQL: pgsql/src/bin/psql/command.c,v 1.130 2004/11/04 22:25:14 momjian Exp $
6+
* $PostgreSQL: pgsql/src/bin/psql/command.c,v 1.131 2004/11/06 04:29:40 momjian Exp $
77
*/
88
#include"postgres_fe.h"
99
#include"command.h"
@@ -1525,7 +1525,11 @@ do_pset(const char *param, const char *value, printQueryOpt *popt, bool quiet)
15251525

15261526

15271527

1528+
#ifndefWIN32
15281529
#defineDEFAULT_SHELL "/bin/sh"
1530+
#else
1531+
#defineDEFAULT_SHELL "c:/windows/system32/cmd.exe"
1532+
#endif
15291533

15301534
staticbool
15311535
do_shell(constchar*command)
@@ -1537,11 +1541,11 @@ do_shell(const char *command)
15371541
char*sys;
15381542
constchar*shellName=NULL;
15391543

1544+
shellName=getenv("SHELL");
15401545
#ifdefWIN32
1541-
shellName=getenv("COMSPEC");
1542-
#endif
15431546
if (shellName==NULL)
1544-
shellName=getenv("SHELL");
1547+
shellName=getenv("COMSPEC");
1548+
#endif
15451549
if (shellName==NULL)
15461550
shellName=DEFAULT_SHELL;
15471551

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp