diff --git a/src/ChangeLog b/src/ChangeLog index 934be235..dacb4e7e 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2004-01-29 Hrvoje Niksic + + * utils.c (determine_screen_width): Return 0 if not running on + Windows or on a TIOCGWINSZ-capable system. + 2004-01-28 David Fritz * utils.c (determine_screen_width): Correctly determine console diff --git a/src/utils.c b/src/utils.c index c096b3e7..2bb59935 100644 --- a/src/utils.c +++ b/src/utils.c @@ -1674,10 +1674,12 @@ determine_screen_width (void) #else /* not TIOCGWINSZ */ # ifdef WINDOWS CONSOLE_SCREEN_BUFFER_INFO csbi; - if (!GetConsoleScreenBufferInfo (GetStdHandle (STD_OUTPUT_HANDLE), &csbi)) + if (!GetConsoleScreenBufferInfo (GetStdHandle (STD_ERROR_HANDLE), &csbi)) return 0; return csbi.dwSize.X; -# endif /* WINDOWS */ +# else /* neither WINDOWS nor TIOCGWINSZ */ + return 0; +#endif /* neither WINDOWS nor TIOCGWINSZ */ #endif /* not TIOCGWINSZ */ }