From 54691771831c97c7366bf8ee7c54da3952c22120 Mon Sep 17 00:00:00 2001 From: Aaron Griffin Date: Wed, 22 Nov 2006 04:53:10 +0000 Subject: Removed global maxcols - it is looked up on the fly now, so the progress bar is resized. Also used ioctl in place of the COLUMNS env variable --- src/pacman/trans.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/pacman/trans.c') diff --git a/src/pacman/trans.c b/src/pacman/trans.c index 0b141906..1b9295e1 100644 --- a/src/pacman/trans.c +++ b/src/pacman/trans.c @@ -40,7 +40,6 @@ #define LOG_STR_LEN 256 extern config_t *config; -extern unsigned int maxcols; int prevpercent=0; /* for less progressbar output */ @@ -154,6 +153,7 @@ void cb_trans_evt(unsigned char event, void *data1, void *data2) break; case PM_TRANS_EVT_RETRIEVE_LOCAL: MSG(NL, " %s [", (char*)data1); + unsigned int maxcols = getcols(); STRNCPY(out, (char*)data2, maxcols-42); MSG(CL, "%s", out); for(i = strlen(out); i < maxcols-43; i++) { @@ -287,6 +287,7 @@ void cb_trans_progress(unsigned char event, char *pkgname, int percent, int howm static int lasthash = 0, mouth = 0; int i, hash; long chomp = 0; + unsigned int maxcols = getcols(); unsigned int maxpkglen, progresslen = maxcols - 57; char *ptr = NULL; -- cgit v1.2.3