mirror of
https://github.com/moparisthebest/wget
synced 2024-07-03 16:38:41 -04:00
[svn] Correctly determine screen size under Windows.
This commit is contained in:
parent
2c0e2b0afa
commit
4d626daf5a
@ -1,3 +1,8 @@
|
||||
2004-01-28 David Fritz <zeroxdf@att.net>
|
||||
|
||||
* utils.c (determine_screen_width): Correctly determine console
|
||||
width under Windows.
|
||||
|
||||
2004-01-28 Christian Biere <christianbiere@gmx.de>
|
||||
|
||||
* progress.c (bar_set_params): Fixed syntax error when HAVE_ISATTY
|
||||
|
13
src/utils.c
13
src/utils.c
@ -1659,9 +1659,7 @@ determine_screen_width (void)
|
||||
{
|
||||
/* If there's a way to get the terminal size using POSIX
|
||||
tcgetattr(), somebody please tell me. */
|
||||
#ifndef TIOCGWINSZ
|
||||
return 0;
|
||||
#else /* TIOCGWINSZ */
|
||||
#ifdef TIOCGWINSZ
|
||||
int fd;
|
||||
struct winsize wsz;
|
||||
|
||||
@ -1673,7 +1671,14 @@ determine_screen_width (void)
|
||||
return 0; /* most likely ENOTTY */
|
||||
|
||||
return wsz.ws_col;
|
||||
#endif /* TIOCGWINSZ */
|
||||
#else /* not TIOCGWINSZ */
|
||||
# ifdef WINDOWS
|
||||
CONSOLE_SCREEN_BUFFER_INFO csbi;
|
||||
if (!GetConsoleScreenBufferInfo (GetStdHandle (STD_OUTPUT_HANDLE), &csbi))
|
||||
return 0;
|
||||
return csbi.dwSize.X;
|
||||
# endif /* WINDOWS */
|
||||
#endif /* not TIOCGWINSZ */
|
||||
}
|
||||
|
||||
/* Return a random number between 0 and MAX-1, inclusive.
|
||||
|
Loading…
Reference in New Issue
Block a user