From 8c5f0314a84917fd5c2bbe8f200063f4224baee9 Mon Sep 17 00:00:00 2001 From: Sergio Villar Senin Date: Thu, 22 Apr 2010 17:07:33 +0200 Subject: Do not consider dots in directory names when looking for the extension of a file name --- embed/ephy-embed.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/embed/ephy-embed.c b/embed/ephy-embed.c index 8f2c4738b..3f9084fbd 100644 --- a/embed/ephy-embed.c +++ b/embed/ephy-embed.c @@ -496,6 +496,7 @@ static const char* parse_extension (const char *filename) { const char *compression; + const char *last_separator; compression = file_is_compressed (filename); @@ -522,7 +523,8 @@ parse_extension (const char *filename) } /* no compression, just look for the last dot in the filename */ - return g_strrstr (filename, "."); + last_separator = strrchr (filename, G_DIR_SEPARATOR); + return strrchr ((last_separator) ? last_separator : filename, '.'); } static gboolean -- cgit v1.2.3