mirror of
https://github.com/MidnightCommander/mc
synced 2025-01-13 06:49:22 +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.
|
handling out of get_byte.
|
||||||
* view.c: Cleaned up the code. Added error handling for the
|
* view.c: Cleaned up the code. Added error handling for the
|
||||||
growing buffer case.
|
growing buffer case.
|
||||||
|
* util.c (extension): Simplified the code.
|
||||||
|
|
||||||
2004-12-02 Andrew V. Samoilov <sav@bcs.zp.ua>
|
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 *extension (const char *filename)
|
||||||
{
|
{
|
||||||
const char *d;
|
const char *d = strrchr (filename, '.');
|
||||||
|
return (d != NULL) ? d + 1 : "";
|
||||||
if (!(*filename))
|
|
||||||
return "";
|
|
||||||
|
|
||||||
d = filename + strlen (filename) - 1;
|
|
||||||
for (;d >= filename; d--){
|
|
||||||
if (*d == '.')
|
|
||||||
return d+1;
|
|
||||||
}
|
|
||||||
return "";
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int get_int (const char *file, const char *key, int def)
|
int get_int (const char *file, const char *key, int def)
|
||||||
|
Loading…
Reference in New Issue
Block a user