aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSergio Villar Senin <svillar@igalia.com>2010-04-22 23:07:33 +0800
committerSergio Villar Senin <svillar@igalia.com>2010-05-05 00:38:41 +0800
commit5fb632986fa8ac18cbfbdc0306bca5477f0dba95 (patch)
tree3f2e687ddf80198dd547660f44e8e4f14df3b971
parentaaf35d0a5cb632c57fe84c5d41648168bc703fe4 (diff)
downloadgsoc2013-epiphany-5fb632986fa8ac18cbfbdc0306bca5477f0dba95.tar
gsoc2013-epiphany-5fb632986fa8ac18cbfbdc0306bca5477f0dba95.tar.gz
gsoc2013-epiphany-5fb632986fa8ac18cbfbdc0306bca5477f0dba95.tar.bz2
gsoc2013-epiphany-5fb632986fa8ac18cbfbdc0306bca5477f0dba95.tar.lz
gsoc2013-epiphany-5fb632986fa8ac18cbfbdc0306bca5477f0dba95.tar.xz
gsoc2013-epiphany-5fb632986fa8ac18cbfbdc0306bca5477f0dba95.tar.zst
gsoc2013-epiphany-5fb632986fa8ac18cbfbdc0306bca5477f0dba95.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 994520529..6bfe68b90 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