From 073326715ed2ccf42cafc8f79641c990b267cf2c Mon Sep 17 00:00:00 2001 From: Johannes Hofmann Date: Fri, 22 Feb 2013 20:45:34 +0100 Subject: fix warning in UIcmd_save() --- src/uicmd.cc | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) (limited to 'src') diff --git a/src/uicmd.cc b/src/uicmd.cc index 153d5fb4..f08c7e70 100644 --- a/src/uicmd.cc +++ b/src/uicmd.cc @@ -901,17 +901,10 @@ static int UIcmd_save_file_check(const char *name) static void UIcmd_save(BrowserWindow *bw, const DilloUrl *url, const char *title) { - const char *name; - bool_t first_prompt = 1; + char *SuggestedName = UIcmd_make_save_filename(url); + while (1) { - char *SuggestedName; - - SuggestedName = - first_prompt - ? UIcmd_make_save_filename(url) - : dStrdup(name); - first_prompt = 0; - name = a_Dialog_save_file(title, NULL, SuggestedName); + const char *name = a_Dialog_save_file(title, NULL, SuggestedName); dFree(SuggestedName); if (name) { @@ -932,6 +925,8 @@ static void UIcmd_save(BrowserWindow *bw, const DilloUrl *url, } else { return; /* no name, so Abort */ } + + SuggestedName = dStrdup(name); } } -- cgit v1.2.3