mirror of
https://github.com/MidnightCommander/mc
synced 2024-12-22 20:36:50 +03:00
* util.c (extension): Simplified the code.
This commit is contained in:
parent
91a4d7e764
commit
639e150164
@ -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>
|
||||
|
||||
|
13
src/util.c
13
src/util.c
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user