From 673286d25b694fb0d1cfcbe9f2238646476c9209 Mon Sep 17 00:00:00 2001 From: aurhat Date: Sun, 16 Aug 2015 16:42:20 +0200 Subject: [PATCH] Fix custom packages downloading on Windows --- source/src/client.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/source/src/client.cpp b/source/src/client.cpp index 871832e5..15ac2307 100644 --- a/source/src/client.cpp +++ b/source/src/client.cpp @@ -1156,9 +1156,9 @@ bool requirepackage(int type, const char *path) loopv(pckservers) if(pckservers[i]->responsive) { source = pckservers[i]; break; } if(!source) { conoutf("\f3no responsive source server found, can't download"); return false; } - char *cleanpath = unixpath(newstring(path)); + char *upath = unixpath(newstring(path)), *cleanpath = newstring(path); filtertext(cleanpath, cleanpath, FTXT__MEDIAFILEPATH); - if(strcmp(path, cleanpath)) { conoutf("refuse to download \"%s\": illegal characters", path); delstring(cleanpath); return false; } + if(strcmp(upath, cleanpath)) { conoutf("refuse to download \"%s\": illegal characters", path); delstring(upath); delstring(cleanpath); return false; } if(!havecurl || canceldownloads || type < 0 || type >= PCK_NUM || pendingpackages.access(cleanpath)) { delstring(cleanpath); return false; } package *pck = new package; @@ -1167,6 +1167,7 @@ bool requirepackage(int type, const char *path) pck->source = source; pck->pending = true; pendingpackages.access(pck->name, pck); + delstring(upath); return true; }