[epiphany/gnome-2-30] Do not consider dots in directory names when looking for the extension of a file name



commit 8c5f0314a84917fd5c2bbe8f200063f4224baee9
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 8f2c473..3f9084f 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



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