diff options
author | Shaun McCance <shaunm@gnome.org> | 2010-11-18 11:41:43 -0500 |
---|---|---|
committer | Shaun McCance <shaunm@gnome.org> | 2010-11-18 11:41:43 -0500 |
commit | d8a0c136b10d174beae8fd5cfeeb83ef18e83846 (patch) | |
tree | a472eb5a56a408613ab54c3425d14c98e1ba1d03 | |
parent | 182edd3168fb560529291116a4af6e2b51d28a18 (diff) | |
download | yelp-d8a0c136b10d174beae8fd5cfeeb83ef18e83846.tar.gz |
[yelp-utils] Use g_build_filename to avoid missing slash problem
We were assuming the results of g_get_system_data_dirs have a trailing
slash. They might not, if you set XDG_DATA_DIRS without them.
-rw-r--r-- | src/yelp-utils.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/yelp-utils.c b/src/yelp-utils.c index 7fb79e58..0027e086 100644 --- a/src/yelp-utils.c +++ b/src/yelp-utils.c @@ -116,15 +116,15 @@ resolve_process_ghelp (char *uri, gchar **result) hash = NULL; } for (i = 0; type != YELP_RRN_TYPE_MAL && dirs[i]; i++) { - gchar *path = g_strdup_printf ("%sgnome/help/%s", dirs[i], dir); + gchar *path = g_build_filename (dirs[i], "gnome", "help", dir, NULL); if (g_file_test (path, G_FILE_TEST_IS_DIR)) { const gchar * const *langs = g_get_language_names (); gint j; for (j = 0; type != YELP_RRN_TYPE_MAL && langs[j]; j++) { - gchar *index = g_strdup_printf ("%sgnome/help/%s/%s/index.page", dirs[i], dir, langs[j]); + gchar *index = g_build_filename (dirs[i], "gnome", "help", dir, langs[j], "index.page", NULL); if (g_file_test (index, G_FILE_TEST_IS_REGULAR)) { type = YELP_RRN_TYPE_MAL; - *result = g_strdup_printf ("%sgnome/help/%s/%s/", dirs[i], dir, langs[j]); + *result = g_build_filename (dirs[i], "gnome", "help", dir, langs[j], NULL); } g_free (index); } |