diff --git a/engine/common/common.c b/engine/common/common.c index 1c68a7a6a..237d99fa8 100644 --- a/engine/common/common.c +++ b/engine/common/common.c @@ -1380,9 +1380,19 @@ COM_StripExtension */ void COM_StripExtension (char *in, char *out) { - while (*in && *in != '.') - *out++ = *in++; - *out = 0; + char *s; + + strcpy(out, in); + + s = out+strlen(out); + + while(*s != '/' && s != out) + { + if (*s == '.') + *s = 0; + + s--; + } } /*