From ed6aeaf1e46ec5b381e55252067b2a4d1ec91adc Mon Sep 17 00:00:00 2001
From: Daniel Carl <danielcarl@gmx.de>
Date: Thu, 27 Feb 2014 23:07:02 +0100
Subject: [PATCH] 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.
---
 src/main.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

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);
-- 
2.20.1