[epiphany] Do not consider dots in directory names when looking for the extension of a file name



commit 5fb632986fa8ac18cbfbdc0306bca5477f0dba95
Author: Sergio Villar Senin <svillar igalia com>
Date:   Thu Apr 22 17:07:33 2010 +0200

    Do not consider dots in directory names when looking for the extension of a file name

 embed/ephy-embed.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)
---
diff --git a/embed/ephy-embed.c b/embed/ephy-embed.c
index 9945205..6bfe68b 100644
--- a/embed/ephy-embed.c
+++ b/embed/ephy-embed.c
@@ -365,6 +365,7 @@ static const char*
 parse_extension (const char *filename)
 {
   const char *compression;
+  const char *last_separator;
 
   compression = file_is_compressed (filename);
 
@@ -391,7 +392,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



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]