Fix custom packages downloading on Windows

This commit is contained in:
aurhat
2015-08-16 16:44:04 +02:00
parent 24043589fc
commit 673286d25b
+3 -2
View File
@@ -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;
}