Mercurial > geeqie.yaz
diff src/cache_maint.c @ 533:e62b2e06ab7b
Simplify and optimize extension_find_dot().
author | zas_ |
---|---|
date | Thu, 01 May 2008 18:26:30 +0000 |
parents | b7e99bfeadc9 |
children | 9dc0513837b5 |
line wrap: on
line diff
--- a/src/cache_maint.c Tue Apr 29 22:44:06 2008 +0000 +++ b/src/cache_maint.c Thu May 01 18:26:30 2008 +0000 @@ -68,18 +68,17 @@ static gchar *extension_find_dot(gchar *path) { - gchar *ptr; + gchar *dot = NULL; - if (!path || *path == '\0') return NULL; + if (!path) return NULL; - ptr = path; - while (*ptr != '\0') ptr++; + while (*path != '\0') + { + if (*path == '.') dot = path; + path++; + } - while (ptr > path && *ptr != '.') ptr--; - - if (ptr == path) return NULL; - - return ptr; + return dot; } static gint isempty(const gchar *path)