The attached applied patch tests for COMSPEC in the right place and
supplies a reasonable shell default on Win32.

-- 
  Bruce Momjian                        |  http://candle.pha.pa.us
  [EMAIL PROTECTED]               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073
Index: src/bin/psql/command.c
===================================================================
RCS file: /cvsroot/pgsql/src/bin/psql/command.c,v
retrieving revision 1.130
diff -c -c -r1.130 command.c
*** src/bin/psql/command.c      4 Nov 2004 22:25:14 -0000       1.130
--- src/bin/psql/command.c      6 Nov 2004 04:18:05 -0000
***************
*** 1525,1531 ****
--- 1525,1535 ----
  
  
  
+ #ifndef WIN32
  #define DEFAULT_SHELL "/bin/sh"
+ #else
+ #define DEFAULT_SHELL "c:/windows/system32/cmd.exe"
+ #endif
  
  static bool
  do_shell(const char *command)
***************
*** 1537,1547 ****
                char       *sys;
                const char *shellName = NULL;
  
  #ifdef WIN32
-               shellName = getenv("COMSPEC");
- #endif
                if (shellName == NULL)
!                       shellName = getenv("SHELL");
                if (shellName == NULL)
                        shellName = DEFAULT_SHELL;
  
--- 1541,1551 ----
                char       *sys;
                const char *shellName = NULL;
  
+               shellName = getenv("SHELL");
  #ifdef WIN32
                if (shellName == NULL)
!                       shellName = getenv("COMSPEC");
! #endif
                if (shellName == NULL)
                        shellName = DEFAULT_SHELL;
  
---------------------------(end of broadcast)---------------------------
TIP 4: Don't 'kill -9' the postmaster

Reply via email to