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+ #ifndef WIN32
15281529#define DEFAULT_SHELL "/bin/sh"
1530+ #else
1531+ #define DEFAULT_SHELL "c:/windows/system32/cmd.exe"
1532+ #endif
15291533
15301534static bool
15311535do_shell (const char * command )
@@ -1537,11 +1541,11 @@ do_shell(const char *command)
15371541char * sys ;
15381542const char * shellName = NULL ;
15391543
1544+ shellName = getenv ("SHELL" );
15401545#ifdef WIN32
1541- shellName = getenv ("COMSPEC" );
1542- #endif
15431546if (shellName == NULL )
1544- shellName = getenv ("SHELL" );
1547+ shellName = getenv ("COMSPEC" );
1548+ #endif
15451549if (shellName == NULL )
15461550shellName = DEFAULT_SHELL ;
15471551