aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohannes Hofmann <Johannes.Hofmann@gmx.de>2013-02-22 20:45:34 +0100
committerJohannes Hofmann <Johannes.Hofmann@gmx.de>2013-02-22 20:45:34 +0100
commit073326715ed2ccf42cafc8f79641c990b267cf2c (patch)
tree8c8f506dda9df4fa1333201db00d5326e6cc603b
parentcba0f9f7a7c9066011f305fa92403755f0adab9c (diff)
fix warning in UIcmd_save()
-rw-r--r--src/uicmd.cc15
1 files changed, 5 insertions, 10 deletions
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);
}
}