use get_screen_size from getch2.c instead of ioctl, fixes bug #131.

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@13907 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
reimar 2004-11-09 20:09:26 +00:00
parent 39118cda26
commit d05cfecee8
1 changed files with 3 additions and 5 deletions

View File

@ -815,12 +815,10 @@ static void print_status(float a_pos, float a_v, float corr)
int width; int width;
char *line; char *line;
unsigned pos = 0; unsigned pos = 0;
#ifndef __MINGW32__ get_screen_size();
struct winsize ws; if (screen_width > 0)
if (ioctl(0, TIOCGWINSZ, &ws) != -1 && ws.ws_col) width = screen_width;
width = ws.ws_col;
else else
#endif
width = 80; width = 80;
line = malloc(width + 1); // one additional for terminating null line = malloc(width + 1); // one additional for terminating null