diff options
-rw-r--r-- | about.c | 6 | ||||
-rw-r--r-- | xombrero.c | 17 |
2 files changed, 18 insertions, 5 deletions
diff --git a/about.c b/about.c index 46d0918..fdab608 100644 --- a/about.c +++ b/about.c @@ -1396,6 +1396,7 @@ xtp_page_dl_row(struct tab *t, char *html, struct download *dl) WebKitDownloadStatus stat; const gchar *destination; + gchar *d; char *status_html = NULL, *cmd_html = NULL, *new_html; gdouble progress; char cur_sz[FMT_SCALED_STRSIZE]; @@ -1472,11 +1473,12 @@ xtp_page_dl_row(struct tab *t, char *html, struct download *dl) /* we might not have a destination set yet */ if (!destination) destination = webkit_download_get_suggested_filename(dl->download); + d = g_strdup(destination); /* copy for basename */ new_html = g_strdup_printf( "%s\n<tr><td>%s</td><td>%s</td>" "<td style='text-align:center'>%s</td></tr>\n", - html, basename((char *)destination), - status_html, cmd_html); + html, basename(d), status_html, cmd_html); + g_free(d); g_free(html); if (status_html) diff --git a/xombrero.c b/xombrero.c index 18cc4c8..5561778 100644 --- a/xombrero.c +++ b/xombrero.c @@ -5118,6 +5118,7 @@ download_status_changed_cb(WebKitDownload *download, GParamSpec *spec, const char *uri; char *file = NULL; char *mime = NULL; + char *destination; if (download == NULL) return; @@ -5125,9 +5126,14 @@ download_status_changed_cb(WebKitDownload *download, GParamSpec *spec, if (status != WEBKIT_DOWNLOAD_STATUS_FINISHED) return; - if (download_notifications) + if (download_notifications) { + /* because basename() takes a char * on linux */ + destination = g_strdup( + webkit_download_get_destination_uri(download)); show_oops(NULL, "Download of '%s' finished", - basename(webkit_download_get_destination_uri(download))); + basename(destination)); + g_free(destination); + } uri = webkit_download_get_destination_uri(download); if (uri == NULL) return; @@ -5185,6 +5191,7 @@ download_start(struct tab *t, struct download *d, int flag) gchar *filename = NULL; char *uri = NULL; char *path = NULL; + char *destination; int ret = TRUE; int i; @@ -5254,8 +5261,12 @@ download_start(struct tab *t, struct download *d, int flag) /* get from history */ g_object_ref(d->download); + /* because basename() takes a char * on linux */ + destination = g_strdup( + webkit_download_get_destination_uri(d->download)); show_oops(t, "Download of '%s' started...", - basename(webkit_download_get_destination_uri(d->download))); + basename(destination)); + g_free(destination); } if (flag != XT_DL_START) |