From 74ff01bfb54e9f0a68ac88b827521a422269a144 Mon Sep 17 00:00:00 2001 From: Alan Mishchenko Date: Thu, 15 May 2008 08:01:00 -0700 Subject: Version abc80515 --- src/misc/extra/extraUtilFile.c | 19 ++++--------------- 1 file changed, 4 insertions(+), 15 deletions(-) (limited to 'src/misc/extra') diff --git a/src/misc/extra/extraUtilFile.c b/src/misc/extra/extraUtilFile.c index 243f3457..44dff1e0 100644 --- a/src/misc/extra/extraUtilFile.c +++ b/src/misc/extra/extraUtilFile.c @@ -160,20 +160,10 @@ char * Extra_FileNameAppend( char * pBase, char * pSuffix ) ***********************************************************************/ char * Extra_FileNameGeneric( char * FileName ) { - char * pDot; - char * pUnd; - char * pRes; - - // find the generic name of the file + char * pDot, * pRes; pRes = Extra_UtilStrsav( FileName ); - // find the pointer to the "." symbol in the file name -// pUnd = strstr( FileName, "_" ); - pUnd = NULL; - pDot = strstr( FileName, "." ); - if ( pUnd ) - pRes[pUnd - FileName] = 0; - else if ( pDot ) - pRes[pDot - FileName] = 0; + if ( (pDot = strrchr( pRes, '.' )) ) + *pDot = 0; return pRes; } @@ -193,8 +183,7 @@ char * Extra_FileNameGenericAppend( char * pBase, char * pSuffix ) static char Buffer[1000]; char * pDot; strcpy( Buffer, pBase ); - pDot = strstr( Buffer, "." ); - if ( pDot ) + if ( (pDot = strrchr( Buffer, '.' )) ) *pDot = 0; strcat( Buffer, pSuffix ); return Buffer; -- cgit v1.2.3