From: Daniel Carl Date: Thu, 27 Feb 2014 22:07:02 +0000 (+0100) Subject: Fixed wrong download path for pages with trailing /. X-Git-Url: https://git.owens.tech/about.html/about.html/git?a=commitdiff_plain;h=ed6aeaf1e46ec5b381e55252067b2a4d1ec91adc;p=vimb.git Fixed wrong download path for pages with trailing /. If a page has a URL with a trailing slash, the suggested file name was an empty string. But we appended this empty string as file to the download directory path, so vimb tries to save the download under a directory path an not a file. This patch checks the case where the filename is empty so that the default download file name can be used. --- diff --git a/src/main.c b/src/main.c index 6e807ee..8532898 100644 --- a/src/main.c +++ b/src/main.c @@ -917,7 +917,7 @@ gboolean vb_download(WebKitWebView *view, WebKitDownload *download, const char * file = util_build_path(path, vb.config.download_dir); } else { path = webkit_download_get_suggested_filename(download); - if (!path) { + if (!path || *path == '\0') { path = PROJECT "-donwload"; } file = util_build_path(path, vb.config.download_dir);