From 55eb5c0faab8a20208d6a548c1ebeed6fa4dbe66 Mon Sep 17 00:00:00 2001 From: Wichert Akkerman Date: Wed, 30 Aug 2000 12:26:57 +0000 Subject: [PATCH] check if we are outputing to a tty --- ChangeLog | 5 +++++ main/enquiry.c | 2 ++ 2 files changed, 7 insertions(+) diff --git a/ChangeLog b/ChangeLog index 6c230ed1..3f2cdd88 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +Wed Aug 30 14:24:53 CEST 2000 Wichert Akkerman + + * main/enquiry.c: modify listformatstring() to check if output is + being sent to a tty. If not and no COLUMNS is set use a width of 80 + Mon Aug 21 12:58:15 CEST 2000 Wichert Akkerman * lib/lock.c, main/filesdb.c, main/archives.c, main/configure.c, diff --git a/main/enquiry.c b/main/enquiry.c index 0e614d31..679f6505 100644 --- a/main/enquiry.c +++ b/main/enquiry.c @@ -73,6 +73,8 @@ static const char* listformatstring() { if ((columns=getenv("COLUMNS")) && ((res=atoi(columns))>0)) ws.ws_col=res; + else if (!isatty(fd)) + ws.ws_col=80; else { if ((fd=open("/dev/tty",O_RDONLY))!=-1) { if (ioctl(fd, TIOCGWINSZ, &ws)==-1) -- 2.39.5