[gimp] libgimpbase: move g_get_home_dir() to the scope where it's used



commit 5f26f5402e9cfcaf80ca6015db74706c2f5dd308
Author: Jehan <jehan girinstud io>
Date:   Sun Nov 11 21:22:17 2012 +0900

    libgimpbase: move g_get_home_dir() to the scope where it's used
    
    Fixes warning: variable 'home' set but not used [-Wunused-but-set-variable]

 libgimpbase/gimpenv.c |   15 ++++++---------
 1 files changed, 6 insertions(+), 9 deletions(-)
---
diff --git a/libgimpbase/gimpenv.c b/libgimpbase/gimpenv.c
index 1b74b4c..bc25f4a 100644
--- a/libgimpbase/gimpenv.c
+++ b/libgimpbase/gimpenv.c
@@ -729,18 +729,15 @@ gimp_path_parse (const gchar  *path,
                  gboolean      check,
                  GList       **check_failed)
 {
-  const gchar  *home;
-  gchar       **patharray;
-  GList        *list      = NULL;
-  GList        *fail_list = NULL;
-  gint          i;
-  gboolean      exists    = TRUE;
+  gchar    **patharray;
+  GList     *list      = NULL;
+  GList     *fail_list = NULL;
+  gint       i;
+  gboolean   exists    = TRUE;
 
   if (!path || !*path || max_paths < 1 || max_paths > 256)
     return NULL;
 
-  home = g_get_home_dir ();
-
   patharray = g_strsplit (path, G_SEARCHPATH_SEPARATOR_S, max_paths);
 
   for (i = 0; i < max_paths; i++)
@@ -753,7 +750,7 @@ gimp_path_parse (const gchar  *path,
 #ifndef G_OS_WIN32
       if (*patharray[i] == '~')
         {
-          dir = g_string_new (home);
+          dir = g_string_new (g_get_home_dir ());
           g_string_append (dir, patharray[i] + 1);
         }
       else



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