From 7bb855d3b195c8b74e916897a1b0b1d4981386e7 Mon Sep 17 00:00:00 2001 From: Bruce Momjian Date: Sun, 5 Mar 2006 05:33:19 +0000 Subject: [PATCH] Check for "msys" so it doesn't use 'con' by checking for an evironment variable. --- src/include/port.h | 2 +- src/port/sprompt.c | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/include/port.h b/src/include/port.h index ba80a1bdda..382eb7e95d 100644 --- a/src/include/port.h +++ b/src/include/port.h @@ -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" diff --git a/src/port/sprompt.c b/src/port/sprompt.c index a202882922..c79e67fadf 100644 --- a/src/port/sprompt.c +++ b/src/port/sprompt.c @@ -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); -- 2.39.5