SF.net SVN: geany:[3477] trunk

eht16 at users.sourceforge.net eht16 at xxxxx
Sat Jan 17 13:10:46 UTC 2009


Revision: 3477
          http://geany.svn.sourceforge.net/geany/?rev=3477&view=rev
Author:   eht16
Date:     2009-01-17 13:10:46 +0000 (Sat, 17 Jan 2009)

Log Message:
-----------
Properly fix parsing of compiler error messages.

Modified Paths:
--------------
    trunk/ChangeLog
    trunk/src/msgwindow.c

Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog	2009-01-17 13:10:26 UTC (rev 3476)
+++ trunk/ChangeLog	2009-01-17 13:10:46 UTC (rev 3477)
@@ -12,6 +12,8 @@
    installation when the installation directory were different.
    Install GTK translation files only if installation of translation
    files were requested (saves about 22 MB otherwise).
+ * src/msgwindow.c:
+   Properly fix parsing of compiler error messages.
 
 
 2009-01-16  Nick Treleaven  <nick(dot)treleaven(at)btinternet(dot)com>

Modified: trunk/src/msgwindow.c
===================================================================
--- trunk/src/msgwindow.c	2009-01-17 13:10:26 UTC (rev 3476)
+++ trunk/src/msgwindow.c	2009-01-17 13:10:46 UTC (rev 3477)
@@ -582,7 +582,6 @@
 			path = gtk_tree_model_get_path(model, &iter);
 			find_prev_build_dir(path, model, &dir);
 			gtk_tree_path_free(path);
-			g_strchug(string); /* remove possible leading whitespace */
 			msgwin_parse_compiler_error_line(string, dir, &filename, &line);
 
 			if (dir != NULL)
@@ -683,7 +682,7 @@
 }
 
 
-void parse_compiler_error_line(const gchar *string,
+static void parse_compiler_error_line(const gchar *string,
 		gchar **filename, gint *line)
 {
 	ParseData data = {NULL, NULL, 0, 0, 0};
@@ -855,6 +854,7 @@
 		gchar **filename, gint *line)
 {
 	GeanyFiletype *ft;
+	gchar *trimmed_string;
 
 	*filename = NULL;
 	*line = -1;
@@ -866,15 +866,19 @@
 		dir = build_info.dir;
 	g_return_if_fail(dir != NULL);
 
+	trimmed_string = g_strdup(string);
+	g_strchug(trimmed_string); /* remove possible leading whitespace */
+
 	ft = filetypes[build_info.file_type_id];
 
 	/* try parsing with a custom regex */
-	if (!filetypes_parse_error_message(ft, string, filename, line))
+	if (!filetypes_parse_error_message(ft, trimmed_string, filename, line))
 	{
 		/* fallback to default old-style parsing */
-		parse_compiler_error_line(string, filename, line);
+		parse_compiler_error_line(trimmed_string, filename, line);
 	}
 	make_absolute(filename, dir);
+	g_free(trimmed_string);
 }
 
 


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