From ffd7a64cdcd53471c390e66c91e20997763c7ee2 Mon Sep 17 00:00:00 2001 From: ac-stef Date: Tue, 23 Jun 2015 23:16:14 +0200 Subject: [PATCH] fix tempfile path handling A path can not pass findfile() twice. (And "tmp" has no path delimiters to fix.) --- source/src/client.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/source/src/client.cpp b/source/src/client.cpp index d94e7ccc..2d6cf6e0 100644 --- a/source/src/client.cpp +++ b/source/src/client.cpp @@ -1016,7 +1016,7 @@ VAR(rereadsoundlists, 0, 1, 1); // same for map sounds int processdownload(package *pck) { string tmpname = ""; - copystring(tmpname, findfile(path("tmp", true), "rb")); + copystring(tmpname, findfile("tmp", "rb")); if(!pck->pending) { switch(pck->type) @@ -1033,7 +1033,7 @@ int processdownload(package *pck) case PCK_MAP: case PCK_MAPMODEL: { - addzip(tmpname, pck->name, NULL, true, pck->type); + addzip("tmp", pck->name, NULL, true, pck->type); break; } @@ -1041,7 +1041,7 @@ int processdownload(package *pck) { char *fname = newstring(pck->name), *ls = strrchr(fname, '/'); if(ls) *ls = '\0'; - addzip(tmpname, fname, NULL, true, pck->type); + addzip("tmp", fname, NULL, true, pck->type); rereadtexturelists = 1; break; } @@ -1059,7 +1059,7 @@ int processdownload(package *pck) double dlpackage(package *pck) { if(!pck || !pck->source) return false; - const char *tmpname = findfile(path("tmp", true), "wb"); + const char *tmpname = findfile("tmp", "wb"); FILE *outfile = fopen(tmpname, "wb"); string req, pckname = ""; sprintf(req, "%s/%s%s", pck->source->addr, strreplace(pckname, pck->name, " ", "%20"), (pck->type==PCK_MAP || pck->type==PCK_MAPMODEL || pck->type==PCK_SKYBOX) ? ".zip" : "");