* util.c (extension): Simplified the code.

This commit is contained in:
Roland Illig 2004-12-02 19:39:21 +00:00
parent 91a4d7e764
commit 639e150164
2 changed files with 3 additions and 11 deletions

View File

@ -5,6 +5,7 @@
handling out of get_byte.
* view.c: Cleaned up the code. Added error handling for the
growing buffer case.
* util.c (extension): Simplified the code.
2004-12-02 Andrew V. Samoilov <sav@bcs.zp.ua>

View File

@ -591,17 +591,8 @@ int regexp_match (const char *pattern, const char *string, int match_type)
const char *extension (const char *filename)
{
const char *d;
if (!(*filename))
return "";
d = filename + strlen (filename) - 1;
for (;d >= filename; d--){
if (*d == '.')
return d+1;
}
return "";
const char *d = strrchr (filename, '.');
return (d != NULL) ? d + 1 : "";
}
int get_int (const char *file, const char *key, int def)