3
3
*
4
4
* Copyright (c) 2000-2004, PostgreSQL Global Development Group
5
5
*
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 $
7
7
*/
8
8
#include "postgres_fe.h"
9
9
#include "command.h"
@@ -1525,7 +1525,11 @@ do_pset(const char *param, const char *value, printQueryOpt *popt, bool quiet)
1525
1525
1526
1526
1527
1527
1528
+ #ifndef WIN32
1528
1529
#define DEFAULT_SHELL "/bin/sh"
1530
+ #else
1531
+ #define DEFAULT_SHELL "c:/windows/system32/cmd.exe"
1532
+ #endif
1529
1533
1530
1534
static bool
1531
1535
do_shell (const char * command )
@@ -1537,11 +1541,11 @@ do_shell(const char *command)
1537
1541
char * sys ;
1538
1542
const char * shellName = NULL ;
1539
1543
1544
+ shellName = getenv ("SHELL" );
1540
1545
#ifdef WIN32
1541
- shellName = getenv ("COMSPEC" );
1542
- #endif
1543
1546
if (shellName == NULL )
1544
- shellName = getenv ("SHELL" );
1547
+ shellName = getenv ("COMSPEC" );
1548
+ #endif
1545
1549
if (shellName == NULL )
1546
1550
shellName = DEFAULT_SHELL ;
1547
1551