mirror of
https://github.com/nzp-team/fteqw.git
synced 2025-01-20 15:31:02 +00:00
Strip all extensions before trying to add new ones to image file names.
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@3097 fc73d0e0-1445-4013-8a0c-d673dee63da5
This commit is contained in:
parent
45692d1d1e
commit
7f90f66bfc
2 changed files with 21 additions and 1 deletions
|
@ -1973,7 +1973,7 @@ int Mod_LoadHiResTexture(char *name, char *subpath, qboolean mipmap, qboolean al
|
|||
|
||||
int i, e;
|
||||
|
||||
COM_StripExtension(name, nicename, sizeof(nicename));
|
||||
COM_StripAllExtensions(name, nicename, sizeof(nicename));
|
||||
|
||||
while((data = strchr(nicename, '*')))
|
||||
{
|
||||
|
|
|
@ -1469,6 +1469,26 @@ void COM_StripExtension (char *in, char *out, int outlen)
|
|||
}
|
||||
}
|
||||
|
||||
void COM_StripAllExtensions (char *in, char *out, int outlen)
|
||||
{
|
||||
char *s;
|
||||
|
||||
if (out != in)
|
||||
Q_strncpyz(out, in, outlen);
|
||||
|
||||
s = out+strlen(out);
|
||||
|
||||
while(*s != '/' && s != out)
|
||||
{
|
||||
if (*s == '.')
|
||||
{
|
||||
*s = 0;
|
||||
}
|
||||
|
||||
s--;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
============
|
||||
COM_FileExtension
|
||||
|
|
Loading…
Reference in a new issue