index : pacman | |
Archlinux32 fork of pacman | gitolite user |
summaryrefslogtreecommitdiff |
-rw-r--r-- | src/pacman/downloadprog.c | 5 | ||||
-rw-r--r-- | src/pacman/log.c | 4 | ||||
-rw-r--r-- | src/pacman/trans.c | 5 |
diff --git a/src/pacman/downloadprog.c b/src/pacman/downloadprog.c index 6a1b4824..0d5a9b22 100644 --- a/src/pacman/downloadprog.c +++ b/src/pacman/downloadprog.c @@ -62,6 +62,11 @@ void log_progress(const char *filename, int xfered, int total) return; } + /* XXX: big fat hack: due to the fact that we switch out printf/pm_fprintf, + * not everything honors our 'neednl' newline hackery. This forces a newline + * if we need one before drawing the progress bar */ + MSG(NL,NULL); + /* this is basically a switch on xferred: 0, total, and anything else */ if(xfered == 0) { /* set default starting values */ diff --git a/src/pacman/log.c b/src/pacman/log.c index a639159f..501f32d2 100644 --- a/src/pacman/log.c +++ b/src/pacman/log.c @@ -113,6 +113,10 @@ void pm_fprintf(FILE *file, unsigned short line, char *fmt, ...) neednl = 0; } + if(!fmt) { + return; + } + va_start(args, fmt); vsnprintf(str, LOG_STR_LEN, fmt, args); va_end(args); diff --git a/src/pacman/trans.c b/src/pacman/trans.c index 22443216..ebc11a8d 100644 --- a/src/pacman/trans.c +++ b/src/pacman/trans.c @@ -287,6 +287,11 @@ void cb_trans_progress(pmtransprog_t event, char *pkgname, const int percent, return; } + /* XXX: big fat hack: due to the fact that we switch out printf/pm_fprintf, + * not everything honors our 'neednl' newline hackery. This forces a newline + * if we need one before drawing the progress bar */ + MSG(NL,NULL); + if(percent == 0) { set_output_padding(1); /* turn on output padding with ' ' */ timediff = get_update_timediff(1); |