xbps-bin: get_maxcols(): use stdin to make it work in all cases (from xdave).
This commit is contained in:
@@ -221,7 +221,7 @@ get_maxcols(void)
|
|||||||
{
|
{
|
||||||
struct winsize ws;
|
struct winsize ws;
|
||||||
|
|
||||||
if (ioctl(1, TIOCGWINSZ, &ws) == 0)
|
if (ioctl(fileno(stdin), TIOCGWINSZ, &ws) == 0)
|
||||||
return ws.ws_col;
|
return ws.ws_col;
|
||||||
|
|
||||||
return 80;
|
return 80;
|
||||||
|
|||||||
Reference in New Issue
Block a user