diff options
author | Aaron Griffin <aaron@archlinux.org> | 2006-11-22 05:53:10 +0100 |
---|---|---|
committer | Aaron Griffin <aaron@archlinux.org> | 2006-11-22 05:53:10 +0100 |
commit | 54691771831c97c7366bf8ee7c54da3952c22120 (patch) | |
tree | 6db658673d8009bb798c7c053621d431d171c891 /src/pacman/trans.c | |
parent | 3c7f616805b4e7b29a1b5ef8cf218627c9da34bd (diff) | |
download | pacman-54691771831c97c7366bf8ee7c54da3952c22120.tar.gz pacman-54691771831c97c7366bf8ee7c54da3952c22120.tar.xz |
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
Diffstat (limited to 'src/pacman/trans.c')
-rw-r--r-- | src/pacman/trans.c | 3 |
1 files changed, 2 insertions, 1 deletions
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; |