From b5d6325fe30873808923837dc9eca1621197c381 Mon Sep 17 00:00:00 2001 From: Mark Olsen Date: Mon, 25 Jul 2005 13:23:42 +0000 Subject: [PATCH] Redid COM_StripExtension to only strip from the first dot after the last slash in a filename. git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@1158 fc73d0e0-1445-4013-8a0c-d673dee63da5 --- engine/common/common.c | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) 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--; + } } /*