COM_FileBase should strip .ext.gz instead of leaving the .ext there - the .gz is handled by our filesystem so we try to pretend that its not there. This fixes loading textures/foo/bar.png files from inside foo.bsp.gz files.

git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@5882 fc73d0e0-1445-4013-8a0c-d673dee63da5
This commit is contained in:
Spoike 2021-06-01 17:11:13 +00:00
parent c76735b1fc
commit 5ceb4730ad

View file

@ -2431,7 +2431,12 @@ void QDECL COM_StripExtension (const char *in, char *out, int outlen)
if (*s == '.')
{
*s = 0;
break;
//some extensions don't really count, strip the next one too...
if (!strcmp(s+1,"gz"))
;
else
break;
}
s--;
@ -2568,8 +2573,12 @@ void COM_FileBase (const char *in, char *out, int outlen)
s = in + strlen(in) - 1;
while (s > in && *s != '.' && *s != '/')
while (s > in)
{
if ((*s == '.'&&strcmp(s+1,"gz")) || *s == '/')
break;
s--;
}
for (s2 = s ; s2 > in && *s2 && *s2 != '/' ; s2--)
;