Skip to content

Commit

Permalink
Only display the filename when downloading.
Browse files Browse the repository at this point in the history
Fixes issue freebsd#219
  • Loading branch information
jlaffaye committed May 1, 2012
1 parent 0c8f377 commit 69c5f1c
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion pkg/event.c
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ event_callback(void *data, struct pkg_event *ev)
int *debug = data;
(void) debug;
const char *name, *version, *newversion;
const char *filename;

switch(ev->type) {
case PKG_EVENT_ERRNO:
Expand All @@ -62,7 +63,14 @@ event_callback(void *data, struct pkg_event *ev)
if (quiet)
break;
if (fetched == 0) {
strlcpy(url, ev->e_fetching.url, sizeof(url));
filename = strrchr(ev->e_fetching.url, '/');
if (filename != NULL) {
filename++;
} else {
// We failed at beeing smart, display the entire url
filename = ev->e_fetching.url;
}
strlcpy(url, filename, sizeof(url));
start_progress_meter(url, ev->e_fetching.total, &fetched);
}
fetched = ev->e_fetching.done;
Expand Down

0 comments on commit 69c5f1c

Please sign in to comment.