diff options
author | Claudio Saavedra <csaavedra@igalia.com> | 2013-09-02 05:44:33 +0800 |
---|---|---|
committer | Claudio Saavedra <csaavedra@igalia.com> | 2013-09-02 05:53:47 +0800 |
commit | 8b9bfed919c6e105d40e5cd730469fa550281e5e (patch) | |
tree | 0e5ac3eea22dfa72521a4cba990478e180f62116 | |
parent | 205ae3a6b5a6da8c873023ae5a9afbcee004271e (diff) | |
download | gsoc2013-epiphany-8b9bfed919c6e105d40e5cd730469fa550281e5e.tar.gz gsoc2013-epiphany-8b9bfed919c6e105d40e5cd730469fa550281e5e.tar.zst gsoc2013-epiphany-8b9bfed919c6e105d40e5cd730469fa550281e5e.zip |
test-ephy-embed-shell: Do not assume XDG_DATA_DIRS is set
Otherwise the test will fail in systens where this is unset.
-rw-r--r-- | tests/ephy-embed-shell-test.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/tests/ephy-embed-shell-test.c b/tests/ephy-embed-shell-test.c index 7ba25ca42..b41d03ad1 100644 --- a/tests/ephy-embed-shell-test.c +++ b/tests/ephy-embed-shell-test.c @@ -87,15 +87,17 @@ main (int argc, char *argv[]) { int ret; const char *xdg_data_dirs; - char **dirs; + char **dirs = NULL; char *schemas_dir; /* Save XDG_DATA_DIRS to set GSETTINGS_SCHEME_DIR, otherwise we * won't find the sytem schemas. */ xdg_data_dirs = g_getenv ("XDG_DATA_DIRS"); - dirs = g_strsplit (xdg_data_dirs, ":", -1); + if (xdg_data_dirs) + dirs = g_strsplit (xdg_data_dirs, ":", -1); + /* We can only use one directory, so use the first one or the system default. */ - schemas_dir = g_build_filename (dirs[0] ? dirs[0] : "/usr/share", "glib-2.0", "schemas", NULL); + schemas_dir = g_build_filename (dirs ? dirs[0] : "/usr/share", "glib-2.0", "schemas", NULL); g_setenv ("GSETTINGS_SCHEMA_DIR", schemas_dir, TRUE); g_strfreev (dirs); g_free (schemas_dir); |