diff options
author | Alan Mishchenko <alanmi@berkeley.edu> | 2007-01-10 08:01:00 -0800 |
---|---|---|
committer | Alan Mishchenko <alanmi@berkeley.edu> | 2007-01-10 08:01:00 -0800 |
commit | 8dfe404863427d5e7b18d055ffd78b453835f959 (patch) | |
tree | f0efcc544e0501aa6477948744e4d2788a4fb965 /src/misc/extra/extraUtilFile.c | |
parent | be6a484a997a8477d4c3b03c17f798c1b0061bf1 (diff) | |
download | abc-8dfe404863427d5e7b18d055ffd78b453835f959.tar.gz abc-8dfe404863427d5e7b18d055ffd78b453835f959.tar.bz2 abc-8dfe404863427d5e7b18d055ffd78b453835f959.zip |
Version abc70110
Diffstat (limited to 'src/misc/extra/extraUtilFile.c')
-rw-r--r-- | src/misc/extra/extraUtilFile.c | 19 |
1 files changed, 6 insertions, 13 deletions
diff --git a/src/misc/extra/extraUtilFile.c b/src/misc/extra/extraUtilFile.c index 9a47750f..14c987e8 100644 --- a/src/misc/extra/extraUtilFile.c +++ b/src/misc/extra/extraUtilFile.c @@ -110,7 +110,7 @@ char * Extra_FileGetSimilarName( char * pFileNameWrong, char * pS1, char * pS2, /**Function************************************************************* - Synopsis [] + Synopsis [Returns the pointer to the file extension.] Description [] @@ -119,21 +119,14 @@ char * Extra_FileGetSimilarName( char * pFileNameWrong, char * pS1, char * pS2, SeeAlso [] ***********************************************************************/ -int Extra_FileNameCheckExtension( char * FileName, char * Extension ) +char * Extra_FileNameExtension( char * FileName ) { char * pDot; - // find "dot" if it is present in the file name -// pDot = strstr( FileName, "." ); + // find the last "dot" in the file name, if it is present for ( pDot = FileName + strlen(FileName)-1; pDot >= FileName; pDot-- ) if ( *pDot == '.' ) - break; - if ( *pDot != '.' ) - return 0; - // check the extension - if ( pDot && strcmp( pDot+1, Extension ) == 0 ) - return 1; - else - return 0; + return pDot + 1; + return NULL; } /**Function************************************************************* @@ -255,8 +248,8 @@ char * Extra_FileRead( FILE * pFile ) char * Extra_TimeStamp() { static char Buffer[100]; - time_t ltime; char * TimeStamp; + time_t ltime; // get the current time time( <ime ); TimeStamp = asctime( localtime( <ime ) ); |