mirror of
https://github.com/freebsd/freebsd-src
synced 2024-10-04 23:50:27 +00:00
Ignore COLUMNS environment variable if it is empty (SUSv3)
This commit is contained in:
parent
8358edb6c7
commit
3714ae1254
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=97801
|
@ -470,7 +470,7 @@ lputs(s)
|
|||
static int termwidth = -1;
|
||||
|
||||
if (termwidth == -1) {
|
||||
if ((p = getenv("COLUMNS")))
|
||||
if ((p = getenv("COLUMNS")) && *p != '\0')
|
||||
termwidth = atoi(p);
|
||||
else if (ioctl(STDOUT_FILENO, TIOCGWINSZ, &win) == 0 &&
|
||||
win.ws_col > 0)
|
||||
|
|
Loading…
Reference in a new issue