Check for "msys" so it doesn't use 'con' by checking for an evironment
authorBruce Momjian <[email protected]>
Sun, 5 Mar 2006 05:33:47 +0000 (05:33 +0000)
committerBruce Momjian <[email protected]>
Sun, 5 Mar 2006 05:33:47 +0000 (05:33 +0000)
variable.

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

index 90441392dc7ff393c6bc496f867b3d1d9a4b6a80..db4cc60e6d91e078db96db3f28ed0dbeaa79a4fc 100644 (file)
@@ -80,7 +80,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 da47582764dddffa8ae1067a5bb1cf9a794a7464..2e2435de4b71fa81bc956c7df396cfc90ba16397 100644 (file)
@@ -66,7 +66,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);