SF.net SVN: geany:[3566] trunk

eht16 at users.sourceforge.net eht16 at xxxxx
Sun Feb 8 19:51:49 UTC 2009


Revision: 3566
          http://geany.svn.sourceforge.net/geany/?rev=3566&view=rev
Author:   eht16
Date:     2009-02-08 19:51:49 +0000 (Sun, 08 Feb 2009)

Log Message:
-----------
Fix path quoting problems on Windows.

Modified Paths:
--------------
    trunk/ChangeLog
    trunk/plugins/vcdiff.c

Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog	2009-02-08 19:51:31 UTC (rev 3565)
+++ trunk/ChangeLog	2009-02-08 19:51:49 UTC (rev 3566)
@@ -3,6 +3,8 @@
  * plugins/filebrowser.c:
    Make Menu key and Shift-F10 working on the filebrowser treeview.
    Return TRUE if appropriate in the event handlers.
+ * plugins/vcdiff.c:
+   Fix path quoting problems on Windows.
 
 
 2009-02-08  Frank Lanitz  <frank(at)frank(dot)uvena(dot)de>

Modified: trunk/plugins/vcdiff.c
===================================================================
--- trunk/plugins/vcdiff.c	2009-02-08 19:51:31 UTC (rev 3565)
+++ trunk/plugins/vcdiff.c	2009-02-08 19:51:49 UTC (rev 3566)
@@ -196,6 +196,17 @@
 }
 
 
+static gchar *quote_path(const gchar *path)
+{
+#ifdef G_OS_WIN32
+	/* On Windows we need to quote the path in order to handle spaces in paths correctly. */
+	return g_strconcat("\"", path, "\"", NULL);
+#else
+	return g_strdup(path);
+#endif
+}
+
+
 static void* get_cmd_env(gint cmd_type, gboolean cmd, const gchar* filename, int *size)
 {
 	int i;
@@ -231,18 +242,18 @@
 	{
 		if (argv[i] == DIRNAME)
 		{
-			ret[i] = g_strdup(dir);
+			ret[i] = quote_path(dir);
 		}
 		else if (argv[i] == FILENAME)
 		{
-			ret[i] = g_strdup(filename);
+			ret[i] = quote_path(filename);
 		}
 		else if (argv[i] == BASE_FILENAME)
 		{
-			ret[i] = g_strdup(base_filename);
+			ret[i] = quote_path(base_filename);
 		}
 		else
-			ret[i] = g_strdup(argv[i]);
+			ret[i] = quote_path(argv[i]);
 	}
 
 	*size = len;
@@ -345,7 +356,7 @@
 		/* CVS dump stuff to stderr when diff nested dirs */
 		if (strcmp(argv[0], "cvs") != 0 && NZV(std_error))
 		{
-			dialogs_show_msgbox(1,
+			dialogs_show_msgbox(GTK_MESSAGE_WARNING,
 				_("%s exited with an error: \n%s."), argv[0], g_strstrip(std_error));
 		}
 		else if (NZV(std_output))


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.



More information about the Commits mailing list