summaryrefslogtreecommitdiffstats
path: root/usr.bin/sed/process.c
diff options
context:
space:
mode:
authortjr <tjr@FreeBSD.org>2002-06-04 10:00:08 +0000
committertjr <tjr@FreeBSD.org>2002-06-04 10:00:08 +0000
commit86435d3331f2d371b65a2d4ec20de82641760f41 (patch)
tree05bd9e9085811cab7b4068d182abf71eac8e974e /usr.bin/sed/process.c
parentf91c8f40be0986622f27dff87bd398261ee82d38 (diff)
downloadFreeBSD-src-86435d3331f2d371b65a2d4ec20de82641760f41.zip
FreeBSD-src-86435d3331f2d371b65a2d4ec20de82641760f41.tar.gz
Ignore COLUMNS environment variable if it is empty (SUSv3)
Diffstat (limited to 'usr.bin/sed/process.c')
-rw-r--r--usr.bin/sed/process.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/usr.bin/sed/process.c b/usr.bin/sed/process.c
index aa44378..7efdeed 100644
--- a/usr.bin/sed/process.c
+++ b/usr.bin/sed/process.c
@@ -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)
OpenPOWER on IntegriCloud