psql \! WIN32 cleanup - Mailing list pgsql-patches

From Bruce Momjian
Subject psql \! WIN32 cleanup
Date
Msg-id 200411060429.iA64Ti412489@candle.pha.pa.us
Whole thread Raw
Responses Re: psql \! WIN32 cleanup  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-patches
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
  pgman@candle.pha.pa.us               |  (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;


pgsql-patches by date:

Previous
From: Tom Lane
Date:
Subject: Re: yet another .exe path fix
Next
From: Alvaro Herrera
Date:
Subject: ON COMMIT and foreign keys