gimp r26865 - in trunk: . tools



Author: tml
Date: Thu Sep  4 17:46:51 2008
New Revision: 26865
URL: http://svn.gnome.org/viewvc/gimp?rev=26865&view=rev

Log:
2008-09-04  Tor Lillqvist  <tml novell com>

	* tools/gimptool.c: Make it compile without warnings also with gcc
	-Wwrite-strings. Use cmd.exe instead of command.com to execute the
	COPY and DEL commands on Windows.



Modified:
   trunk/ChangeLog
   trunk/tools/gimptool.c

Modified: trunk/tools/gimptool.c
==============================================================================
--- trunk/tools/gimptool.c	(original)
+++ trunk/tools/gimptool.c	Thu Sep  4 17:46:51 2008
@@ -92,12 +92,12 @@
 #ifdef G_OS_WIN32
 
 static gchar *
-win32_command (gchar *command)
+win32_command (const gchar *command)
 {
-  gchar *comspec = getenv ("COMSPEC");
+  const gchar *comspec = getenv ("COMSPEC");
 
   if (!comspec)
-    comspec = "command.com";
+    comspec = "cmd.exe";
 
   return g_strdup_printf ("%s /c %s", comspec, command);
 }
@@ -221,20 +221,25 @@
 #endif
 }
 
-static gchar *
+static const gchar *
 expand_and_munge (const gchar *value)
 {
+  const gchar *retval;
+
   if (starts_with_dir (value, "${prefix}"))
-    value = g_strconcat (PREFIX, value + strlen ("${prefix}"), NULL);
+    retval = g_strconcat (PREFIX, value + strlen ("${prefix}"), NULL);
   else if (starts_with_dir (value, "${exec_prefix}"))
-    value = g_strconcat (EXEC_PREFIX, value + strlen ("${exec_prefix}"), NULL);
-  if (starts_with_dir (value, EXEC_PREFIX))
-    value = g_strconcat (get_exec_prefix ('/'), value + strlen (EXEC_PREFIX), NULL);
+    retval = g_strconcat (EXEC_PREFIX, value + strlen ("${exec_prefix}"), NULL);
+  else
+    retval = g_strdup (value);
+
+  if (starts_with_dir (retval, EXEC_PREFIX))
+    retval = g_strconcat (get_exec_prefix ('/'), retval + strlen (EXEC_PREFIX), NULL);
 
-  if (starts_with_dir (value, PREFIX))
-    value = g_strconcat (get_runtime_prefix ('/'), value + strlen (PREFIX), NULL);
+  if (starts_with_dir (retval, PREFIX))
+    retval = g_strconcat (get_runtime_prefix ('/'), retval + strlen (PREFIX), NULL);
 
-  return value;
+  return retval;
 }
 
 static void
@@ -423,7 +428,7 @@
 	    const gchar *what)
 {
   gchar       *cmd;
-  gchar       *dest_dir;
+  const gchar *dest_dir;
   const gchar *output_flag;
   gchar       *dest_exe;
   const gchar *here_comes_linker_flags = "";



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