diff options
author | Bruce Momjian | 2006-03-05 05:33:47 +0000 |
---|---|---|
committer | Bruce Momjian | 2006-03-05 05:33:47 +0000 |
commit | 9332d22d786578b9c4baa0b34ba94aa688826372 (patch) | |
tree | 6146caee39079322a9b84967a262af2186707e52 | |
parent | 514ba9018f9b89f75322a706eae5c7dc0e3ebc29 (diff) |
Check for "msys" so it doesn't use 'con' by checking for an evironment
variable.
-rw-r--r-- | src/include/port.h | 2 | ||||
-rw-r--r-- | 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); |