David Fritz <[EMAIL PROTECTED]> writes: > It occurs to me now that the code should use STD_ERROR_HANDLE > instead of STD_OUTPUT_HANDLE as that is where the progress bar > goes. As it is, if stdout is redirected wget uses the default screen > width even though output goes to stderr which is still a screen > buffer.
OK. > Also, there appears to have been a slight oversight when reformatting > the patch. From looking at the code, it seems that > determine_screen_width() will no longer return a value (zero) when > neither TIOCGWINSZ nor WINDOWS are defined. You're right. This patch should fix both problems. 2004-01-29 Hrvoje Niksic <[EMAIL PROTECTED]> * utils.c (determine_screen_width): Return 0 if not running on Windows or on a TIOCGWINSZ-capable system. Index: src/utils.c =================================================================== RCS file: /pack/anoncvs/wget/src/utils.c,v retrieving revision 1.76 diff -u -r1.76 utils.c --- src/utils.c 2004/01/28 13:42:52 1.76 +++ src/utils.c 2004/01/29 12:37:50 @@ -1674,10 +1674,12 @@ #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 */ }