From 716d3b66db04b482e2075798dafea7cd464d025f Mon Sep 17 00:00:00 2001 From: Wichert Akkerman Date: Wed, 5 Jul 2000 16:04:47 +0000 Subject: [PATCH] main/enquiry.c: modify getttywidth() to check COLUMNS environment scripts/controllib.pl: remove warnings for LOGNAME stuff --- ChangeLog | 5 +++++ debian/changelog | 1 + main/enquiry.c | 3 +++ scripts/controllib.pl | 9 --------- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/ChangeLog b/ChangeLog index ebfcc493..cff3ef5e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +Tue Jul 4 17:29:06 CEST 2000 Wichert Akkerman + + * main/enquiry.c: modify getttywidth() to check COLUMNS environment + * scripts/controllib.pl: remove warnings for LOGNAME stuff + Wed Jun 28 19:50:00 CEST 2000 peter karlsson * po/sv.po: Updated Swedish translation from comments received. diff --git a/debian/changelog b/debian/changelog index 337bde69..ecf8d356 100644 --- a/debian/changelog +++ b/debian/changelog @@ -13,6 +13,7 @@ dpkg (1.7.0) unstable; urgency=low * dpkg-deb: reorder files when building a package * dpkg-statoverride: new tool to override ownership and modes for files * Modify dpkg and dselect to allow versioned provides + * Check COLUMNS environment for dpkg -l output. Closes: Bug#65536 -- Wichert Akkerman UNRELEASED diff --git a/main/enquiry.c b/main/enquiry.c index 51b5e1ec..d8b17eed 100644 --- a/main/enquiry.c +++ b/main/enquiry.c @@ -64,7 +64,10 @@ static int getttywidth() { int fd; int res; struct winsize ws; + char *columns; + if ((columns=getenv("COLUMNS")) && ((res=atoi(columns))>0)) + return res; if ((fd=open("/dev/tty",O_RDONLY))!=-1) { if (ioctl(fd, TIOCGWINSZ, &ws)==-1) ws.ws_col=80; diff --git a/scripts/controllib.pl b/scripts/controllib.pl index f7a308de..be249b38 100755 --- a/scripts/controllib.pl +++ b/scripts/controllib.pl @@ -51,15 +51,6 @@ if(!defined($getlogin)) { } if (defined ($ENV{'LOGNAME'})) { - if (!defined ($getlogin)) { - # Hmmm, do we really need this? - # warn (sprintf ('no utmp entry available, using value of LOGNAME ("%s")', $ENV{'LOGNAME'})); - } else { - if ($getlogin ne $ENV{'LOGNAME'}) { - warn (sprintf ('utmp entry ("%s") does not match value of LOGNAME ("%s"); using "%s"', - $getlogin, $ENV{'LOGNAME'}, $ENV{'LOGNAME'})); - } - } @fowner = getpwnam ($ENV{'LOGNAME'}); if (! @fowner) { die (sprintf ('unable to get login information for username "%s"', $ENV{'LOGNAME'})); } } elsif (defined ($getlogin)) { -- 2.39.5