aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSergio Villar Senin <svillar@igalia.com>2010-04-22 23:07:33 +0800
committerDiego Escalante Urrelo <descalante@igalia.com>2010-08-31 04:32:56 +0800
commit8c5f0314a84917fd5c2bbe8f200063f4224baee9 (patch)
treedcea92ffe2d6205986b51acf2f7b425eb0200a14
parent7fd56a929a4f75e0f8fdf1bf984dc339fdbe7d39 (diff)
downloadgsoc2013-epiphany-8c5f0314a84917fd5c2bbe8f200063f4224baee9.tar
gsoc2013-epiphany-8c5f0314a84917fd5c2bbe8f200063f4224baee9.tar.gz
gsoc2013-epiphany-8c5f0314a84917fd5c2bbe8f200063f4224baee9.tar.bz2
gsoc2013-epiphany-8c5f0314a84917fd5c2bbe8f200063f4224baee9.tar.lz
gsoc2013-epiphany-8c5f0314a84917fd5c2bbe8f200063f4224baee9.tar.xz
gsoc2013-epiphany-8c5f0314a84917fd5c2bbe8f200063f4224baee9.tar.zst
gsoc2013-epiphany-8c5f0314a84917fd5c2bbe8f200063f4224baee9.zip
Do not consider dots in directory names when looking for the extension of a file name
-rw-r--r--embed/ephy-embed.c4
1 files changed, 3 insertions, 1 deletions
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