summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2012-03-12 23:02:57 +0300
committerAndrei Karas <akaras@inbox.ru>2012-03-12 23:02:57 +0300
commit9e53440cb2dbcfd4311ce2566eb98839383738c7 (patch)
tree364f14988d0e0aac5ee33ed56676886a52209714 /src
parent6bde574ad29e04b0a355cea2915e4e48bd1d56f4 (diff)
downloadplus-9e53440cb2dbcfd4311ce2566eb98839383738c7.tar.gz
plus-9e53440cb2dbcfd4311ce2566eb98839383738c7.tar.bz2
plus-9e53440cb2dbcfd4311ce2566eb98839383738c7.tar.xz
plus-9e53440cb2dbcfd4311ce2566eb98839383738c7.zip
Fix servers list download error.
Diffstat (limited to 'src')
-rw-r--r--src/gui/serverdialog.cpp5
-rw-r--r--src/net/download.cpp21
2 files changed, 13 insertions, 13 deletions
diff --git a/src/gui/serverdialog.cpp b/src/gui/serverdialog.cpp
index ed9696892..bae1154e3 100644
--- a/src/gui/serverdialog.cpp
+++ b/src/gui/serverdialog.cpp
@@ -471,10 +471,7 @@ void ServerDialog::downloadServerList()
// Fall back to manaplus.evolonline.org when neither branding nor config set it
if (listFile.empty())
- {
- listFile = "http://manaplus.evolonline.org/"
- "serverlist.xml/serverlist.xml";
- }
+ listFile = "http://manaplus.evolonline.org/serverlist.xml";
if (mDownload)
{
diff --git a/src/net/download.cpp b/src/net/download.cpp
index d20713dfa..bc8ea4f72 100644
--- a/src/net/download.cpp
+++ b/src/net/download.cpp
@@ -306,16 +306,19 @@ int Download::downloadThread(void *ptr)
// Any existing file with this name is deleted first, otherwise
// the rename will fail on Windows.
- ::remove(d->mFileName.c_str());
- ::rename(outFilename.c_str(), d->mFileName.c_str());
-
- // Check if we can open it and no errors were encountered
- // during renaming
- file = fopen(d->mFileName.c_str(), "rb");
- if (file)
+ if (!d->mOptions.cancel)
{
- fclose(file);
- complete = true;
+ ::remove(d->mFileName.c_str());
+ ::rename(outFilename.c_str(), d->mFileName.c_str());
+
+ // Check if we can open it and no errors were encountered
+ // during renaming
+ file = fopen(d->mFileName.c_str(), "rb");
+ if (file)
+ {
+ fclose(file);
+ complete = true;
+ }
}
}
else