[gnome-commander] Build filename using g_build_filename() than g_strdup_printf()



commit d5f7b61b95e635f5d124c283233f6a39363a2b90
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 300f7a3..096520c 100644
--- a/src/gnome-cmd-data.cc
+++ b/src/gnome-cmd-data.cc
@@ -141,7 +141,7 @@ inline void write(XML::xstream &xml, GnomeCmdCon *con, const gchar *name)
 
 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)
@@ -174,7 +174,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)
@@ -219,7 +219,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)
@@ -263,7 +263,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)
@@ -605,7 +605,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)
@@ -655,7 +655,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]