[gnome-software] trivial: Don't include an extra forward slash when setting the application datadir
- From: Richard Hughes <rhughes src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-software] trivial: Don't include an extra forward slash when setting the application datadir
- Date: Sun, 27 Oct 2013 20:49:06 +0000 (UTC)
commit 07779c7edc74ab9a9e9e0865e4f1cd70b0dc6bba
Author: Richard Hughes <richard hughsie com>
Date: Sun Oct 27 20:04:11 2013 +0000
trivial: Don't include an extra forward slash when setting the application datadir
This is just cosmetic, the consumers of this just don't care.
src/plugins/gs-plugin-datadir-filename.c | 9 +++++++--
1 files changed, 7 insertions(+), 2 deletions(-)
---
diff --git a/src/plugins/gs-plugin-datadir-filename.c b/src/plugins/gs-plugin-datadir-filename.c
index 7f53932..c6bc595 100644
--- a/src/plugins/gs-plugin-datadir-filename.c
+++ b/src/plugins/gs-plugin-datadir-filename.c
@@ -81,6 +81,7 @@ gs_plugin_datadir_filename_find (GsPlugin *plugin,
const gchar *id;
gchar *path_tmp = NULL;
gboolean ret;
+ gchar *filename;
gchar *path;
const char * const *datadirs;
int i;
@@ -106,8 +107,12 @@ gs_plugin_datadir_filename_find (GsPlugin *plugin,
/* find if the file exists */
datadirs = g_get_system_data_dirs ();
for (i = 0; datadirs[i]; i++) {
- path = g_strdup_printf ("%s/applications/%s.desktop",
- datadirs[i], gs_app_get_id (app));
+ filename = g_strdup_printf ("%s.desktop", gs_app_get_id (app));
+ path = g_build_filename (datadirs[i],
+ "applications",
+ filename,
+ NULL);
+ g_free (filename);
if (g_file_test (path, G_FILE_TEST_EXISTS)) {
path_tmp = path;
g_mutex_lock (&plugin->priv->plugin_mutex);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]