Check for "msys" so it doesn't use 'con' by checking for an evironment
authorBruce Momjian <bruce@momjian.us>
Sun, 5 Mar 2006 05:33:19 +0000 (05:33 +0000)
committerBruce Momjian <bruce@momjian.us>
Sun, 5 Mar 2006 05:33:19 +0000 (05:33 +0000)
variable.

src/include/port.h
src/port/sprompt.c

index ba80a1bddae93c64e384861cb50b2f3c5252dcdf..382eb7e95d6037a39658c3a7f401e41660e9bb83 100644 (file)
@@ -84,7 +84,7 @@ extern int find_other_exec(const char *argv0, const char *target,
 
 #if defined(WIN32) && !defined(__CYGWIN__)
 #define DEVNULL "nul"
-/* "con" does not work from the MinGW 1.0.10 console. */
+/* "con" does not work from the Msys 1.0.10 console (part of MinGW). */
 #define DEVTTY "con"
 #else
 #define DEVNULL "/dev/null"
index a202882922e6551feeb35f364d881696bd24d419..c79e67fadf74ccdc3245890c766ca5770e42f957 100644 (file)
@@ -65,7 +65,12 @@ simple_prompt(const char *prompt, int maxlen, bool echo)
         */
        termin = fopen(DEVTTY, "r");
        termout = fopen(DEVTTY, "w");
-       if (!termin || !termout)
+       if (!termin || !termout
+#ifdef WIN32
+               /* See DEVTTY comment for msys */
+               || (getenv("OSTYPE") && strcmp(getenv("OSTYPE"), "msys") == 0)
+#endif
+               )
        {
                if (termin)
                        fclose(termin);