[gimp/gimp-2-8] Bug 766327 - gimptool-2.0 not quoting filenames/directories



commit c534a18d1575fc596b7a2c62d16a0fa5116f1c98
Author: Michael Natterer <mitch gimp org>
Date:   Sun May 22 22:38:12 2016 +0200

    Bug 766327 - gimptool-2.0 not quoting filenames/directories
    
    Quote installation paths with g_shell_quote().
    
    (cherry picked from commit c73104e3eabda539d626e1f2081341d9c03dcf77)

 tools/gimptool.c |   18 ++++++++++++------
 1 files changed, 12 insertions(+), 6 deletions(-)
---
diff --git a/tools/gimptool.c b/tools/gimptool.c
index b8ba02d..515942c 100644
--- a/tools/gimptool.c
+++ b/tools/gimptool.c
@@ -476,7 +476,7 @@ do_build_2 (const gchar *cflags,
   else
     q++;
 
-  dest_exe = g_strconcat (q, EXEEXT, NULL);
+  dest_exe = g_strconcat (dest_dir, q, EXEEXT, NULL);
 
   if (msvc_syntax)
     {
@@ -492,19 +492,19 @@ do_build_2 (const gchar *cflags,
 #endif
     }
 
-  cmd = g_strdup_printf ("%s %s %s %s%s%s %s%s %s%s %s %s",
+  cmd = g_strdup_printf ("%s %s %s %s%s %s%s %s%s %s %s",
                         env_cc,
                         env_cflags,
                         cflags,
                         output_flag,
-                        dest_dir,
-                        dest_exe,
+                        g_shell_quote (dest_exe),
                         what,
                         here_comes_linker_flags,
                         env_ldflags,
                         windows_subsystem_flag,
                         libs,
                         env_libs);
+
   maybe_run (cmd);
 }
 
@@ -603,7 +603,10 @@ do_install_bin_2 (const gchar *dir,
                         S_IRGRP | S_IXGRP |
                         S_IROTH | S_IXOTH);
 
-  maybe_run (g_strconcat (COPY, " ", what, " ", dir, NULL));
+  maybe_run (g_strconcat (COPY, " ",
+                          g_shell_quote (what), " ",
+                          g_shell_quote (dir),
+                          NULL));
 }
 
 static void
@@ -622,7 +625,10 @@ static void
 do_uninstall (const gchar *dir,
              const gchar *what)
 {
-  maybe_run (g_strconcat (REMOVE, " ", dir, G_DIR_SEPARATOR_S, what, NULL));
+  maybe_run (g_strconcat (REMOVE, " ",
+                          g_shell_quote (g_strconcat (dir, G_DIR_SEPARATOR_S,
+                                                      what, NULL)),
+                          NULL));
 }
 
 static const gchar *


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