mirror of
https://github.com/moparisthebest/pacman
synced 2024-12-23 00:08:50 -05:00
Fix triple progress bars on download
Signed-off-by: Dave Reisner <d@falconindy.com> Signed-off-by: Dan McGee <dan@archlinux.org>
This commit is contained in:
parent
e6c9076a74
commit
0da6c591c0
@ -47,6 +47,8 @@
|
|||||||
#include "util.h"
|
#include "util.h"
|
||||||
#include "handle.h"
|
#include "handle.h"
|
||||||
|
|
||||||
|
static int prevprogress; /* last download amount */
|
||||||
|
|
||||||
static char *get_filename(const char *url) {
|
static char *get_filename(const char *url) {
|
||||||
char *filename = strrchr(url, '/');
|
char *filename = strrchr(url, '/');
|
||||||
if(filename != NULL) {
|
if(filename != NULL) {
|
||||||
@ -92,7 +94,7 @@ static int curl_progress(void *filename, double dltotal, double dlnow,
|
|||||||
(void)ultotal;
|
(void)ultotal;
|
||||||
(void)ulnow;
|
(void)ulnow;
|
||||||
|
|
||||||
if(dltotal == 0) {
|
if(dltotal == 0 || prevprogress == dltotal) {
|
||||||
return(0);
|
return(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -102,6 +104,8 @@ static int curl_progress(void *filename, double dltotal, double dlnow,
|
|||||||
|
|
||||||
handle->dlcb((const char*)filename, (long)dlnow, (long)dltotal);
|
handle->dlcb((const char*)filename, (long)dlnow, (long)dltotal);
|
||||||
|
|
||||||
|
prevprogress = dlnow;
|
||||||
|
|
||||||
return(0);
|
return(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user