From 58c83a9f48cb96c8bdf3550936f7e3eebb795d70 Mon Sep 17 00:00:00 2001 From: Jonas Fonseca Date: Mon, 6 Nov 2006 04:55:26 +0100 Subject: [PATCH] Never show empty filename in the what-to-do dialog This fixes the last comment of bug 396. --- src/session/download.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/session/download.c b/src/session/download.c index e4999e0a..00ffbabb 100644 --- a/src/session/download.c +++ b/src/session/download.c @@ -1143,8 +1143,15 @@ do_type_query(struct type_query *type_query, unsigned char *ct, struct mime_hand } text = get_dialog_offset(dlg, TYPE_QUERY_WIDGETS_COUNT); - format = _("What would you like to do with the file '%s' (type: %s%s%s)?", term); - snprintf(text, MAX_STR_LEN, format, filename.source, ct, desc_sep, description); + /* For "default directory index pages" with wrong content-type + * the filename can be NULL, e.g. http://www.spamhaus.org in bug 396. */ + if (filename.length) { + format = _("What would you like to do with the file '%s' (type: %s%s%s)?", term); + snprintf(text, MAX_STR_LEN, format, filename.source, ct, desc_sep, description); + } else { + format = _("What would you like to do with the file (type: %s%s%s)?", term); + snprintf(text, MAX_STR_LEN, format, ct, desc_sep, description); + } done_string(&filename);