[geany/geany] 4a0ea0: Do not reallocate the build output/error text received by spawn

Dimitar Zhekov git-noreply at xxxxx
Fri May 15 17:07:22 UTC 2015


Branch:      refs/heads/master
Author:      Dimitar Zhekov <dimitar.zhekov at gmail.com>
Committer:   Dimitar Zhekov <dimitar.zhekov at gmail.com>
Date:        Thu, 19 Mar 2015 17:08:46 UTC
Commit:      4a0ea0ce1f8e0b85fe390d8aa1c7e967a9c92ce7
             https://github.com/geany/geany/commit/4a0ea0ce1f8e0b85fe390d8aa1c7e967a9c92ce7

Log Message:
-----------
Do not reallocate the build output/error text received by spawn


Modified Paths:
--------------
    src/build.c

Modified: src/build.c
11 lines changed, 3 insertions(+), 8 deletions(-)
===================================================================
@@ -124,7 +124,7 @@ static void on_build_next_error(GtkWidget *menuitem, gpointer user_data);
 static void on_build_previous_error(GtkWidget *menuitem, gpointer user_data);
 static void kill_process(GPid *pid);
 static void show_build_result_message(gboolean failure);
-static void process_build_output_line(const gchar *line, gint color);
+static void process_build_output_line(gchar *msg, gint color);
 static void show_build_commands_dialog(void);
 static void on_build_menu_item(GtkWidget *w, gpointer user_data);
 
@@ -920,20 +920,16 @@ static void build_run_cmd(GeanyDocument *doc, guint cmdindex)
 }
 
 
-static void process_build_output_line(const gchar *str, gint color)
+static void process_build_output_line(gchar *msg, gint color)
 {
-	gchar *msg, *tmp;
+	gchar *tmp;
 	gchar *filename;
 	gint line;
 
-	msg = g_strdup(str);
 	g_strchomp(msg);
 
 	if (EMPTY(msg))
-	{
-		g_free(msg);
 		return;
-	}
 
 	if (build_parse_make_dir(msg, &tmp))
 	{
@@ -959,7 +955,6 @@ static void process_build_output_line(const gchar *str, gint color)
 	g_free(filename);
 
 	msgwin_compiler_add_string(color, msg);
-	g_free(msg);
 }
 
 



--------------
This E-Mail was brought to you by github_commit_mail.py (Source: https://github.com/geany/infrastructure).


More information about the Commits mailing list