[gnome-commander/gcmd-1-2-8] Build filename using g_build_filename() than g_strdup_printf()



commit ab22a902e842b4f6640188c0571f07fc32fee7b6
Author: Piotr Eljasiak <epiotr src gnome org>
Date:   Sun Jun 6 18:47:06 2010 +0200

    Build filename using g_build_filename() than g_strdup_printf()

 src/gnome-cmd-data.cc |   12 ++++++------
 1 files changed, 6 insertions(+), 6 deletions(-)
---
diff --git a/src/gnome-cmd-data.cc b/src/gnome-cmd-data.cc
index 320329e..568ca17 100644
--- a/src/gnome-cmd-data.cc
+++ b/src/gnome-cmd-data.cc
@@ -98,7 +98,7 @@ inline gint get_int (const gchar *path, int def)
 
 inline void save_connections (const gchar *fname)
 {
-    gchar *path = g_strdup_printf ("%s/.gnome-commander/%s", g_get_home_dir (), fname);
+    gchar *path = g_build_filename (g_get_home_dir (), ".gnome-commander", fname, NULL);
     FILE  *fd = fopen (path, "w");
 
     if (fd)
@@ -145,7 +145,7 @@ inline void save_connections (const gchar *fname)
 
 inline void save_devices (const gchar *fname)
 {
-    gchar *path = g_strdup_printf ("%s/.gnome-commander/%s", g_get_home_dir (), fname);
+    gchar *path = g_build_filename (g_get_home_dir (), ".gnome-commander", fname, NULL);
     FILE *fd = fopen (path, "w");
 
     if (fd)
@@ -190,7 +190,7 @@ inline void save_devices (const gchar *fname)
 
 inline void save_fav_apps (const gchar *fname)
 {
-    gchar *path = g_strdup_printf ("%s/.gnome-commander/%s", g_get_home_dir (), fname);
+    gchar *path = g_build_filename (g_get_home_dir (), ".gnome-commander", fname, NULL);
     FILE *fd = fopen (path, "w");
 
     if (fd)
@@ -234,7 +234,7 @@ inline gboolean load_connections (const gchar *fname)
 {
     guint prev_ftp_cons_no = g_list_length (gnome_cmd_con_list_get_all_ftp (gnome_cmd_data.priv->con_list));
 
-    gchar *path = g_strdup_printf ("%s/.gnome-commander/%s", g_get_home_dir (), fname);
+    gchar *path = g_build_filename (g_get_home_dir (), ".gnome-commander", fname, NULL);
     FILE  *fd = fopen (path, "r");
 
     if (fd)
@@ -675,7 +675,7 @@ inline void load_vfs_auto_devices ()
 
 inline void load_devices (const gchar *fname)
 {
-    gchar *path = g_strdup_printf ("%s/.gnome-commander/%s", g_get_home_dir (), fname);
+    gchar *path = g_build_filename (g_get_home_dir (), ".gnome-commander", fname, NULL);
     FILE *fd = fopen (path, "r");
 
     if (fd)
@@ -725,7 +725,7 @@ inline void load_devices (const gchar *fname)
 inline void load_fav_apps (const gchar *fname)
 {
     gnome_cmd_data.priv->fav_apps = NULL;
-    gchar *path = g_strdup_printf ("%s/.gnome-commander/%s", g_get_home_dir (), fname);
+    gchar *path = g_build_filename (g_get_home_dir (), ".gnome-commander", fname, NULL);
     FILE *fd = fopen (path, "r");
     if (fd)
     {



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]