check env var exists before comparing (#4)

This commit is contained in:
Dave Murphy 2018-03-19 02:17:45 +00:00 committed by yellows8
parent b53e334c76
commit 42739f52c9

View File

@ -513,9 +513,10 @@ int main(int argc, char **argv) {
return -1;
}
char *msyscon = getenv("MSYSCON");
if (0 == strcmp(msyscon,"mintty.exe")) {
if (msyscon && 0 == strcmp(msyscon,"mintty.exe")) {
setvbuf(stdout, 0, _IONBF, 0);
}