aboutsummaryrefslogtreecommitdiffstats
path: root/src/ephy-seed-extension.c
diff options
context:
space:
mode:
authorXan Lopez <xan@src.gnome.org>2009-02-18 02:19:12 +0800
committerXan Lopez <xan@src.gnome.org>2009-02-18 02:19:12 +0800
commit3bbc37ff26b4c29ce699691edf1035851bfbd171 (patch)
tree67d23c6bc157a14d6509d613d4702040cd0b6ebd /src/ephy-seed-extension.c
parent2e2debc0a6a83153763eb39f036e39f919b7674a (diff)
downloadgsoc2013-epiphany-3bbc37ff26b4c29ce699691edf1035851bfbd171.tar
gsoc2013-epiphany-3bbc37ff26b4c29ce699691edf1035851bfbd171.tar.gz
gsoc2013-epiphany-3bbc37ff26b4c29ce699691edf1035851bfbd171.tar.bz2
gsoc2013-epiphany-3bbc37ff26b4c29ce699691edf1035851bfbd171.tar.lz
gsoc2013-epiphany-3bbc37ff26b4c29ce699691edf1035851bfbd171.tar.xz
gsoc2013-epiphany-3bbc37ff26b4c29ce699691edf1035851bfbd171.tar.zst
gsoc2013-epiphany-3bbc37ff26b4c29ce699691edf1035851bfbd171.zip
Fix finding extensions in system dir.
Also use g_build_filename to build paths and plug a leak. Based on a patch by Diego Escalante Urrelo. Bug #571379 svn path=/trunk/; revision=8791
Diffstat (limited to 'src/ephy-seed-extension.c')
-rw-r--r--src/ephy-seed-extension.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/ephy-seed-extension.c b/src/ephy-seed-extension.c
index 12ff3ebbf..fa0cfff91 100644
--- a/src/ephy-seed-extension.c
+++ b/src/ephy-seed-extension.c
@@ -136,17 +136,19 @@ G_DEFINE_TYPE_WITH_CODE (EphySeedExtension, ephy_seed_extension, G_TYPE_OBJECT,
static gchar *
ephy_seed_extension_get_file (const gchar * name)
{
- gchar *dot_dir, *dot_path, *system_path, *dirname;
+ gchar *dot_path, *system_path, *dirname, *filename;
- dot_dir = g_strconcat (ephy_dot_dir (), "/extensions", NULL);
- dot_path = g_strconcat (dot_dir, "/", name, ".js", NULL);
- g_free (dot_dir);
+ filename = g_strconcat (name, ".js", NULL);
+ dot_path = g_build_filename (ephy_dot_dir(), "extensions", filename, NULL);
if (g_file_test (dot_path, G_FILE_TEST_EXISTS)) {
+ g_free(filename);
return dot_path;
}
+ g_free (dot_path);
- system_path = g_strconcat (EXTENSIONS_DIR, name, NULL);
+ system_path = g_build_filename (EXTENSIONS_DIR, filename, NULL);
+ g_free (filename);
if (g_file_test (system_path, G_FILE_TEST_EXISTS)) {
return system_path;
}