[geany/geany] dccd42: Don't check a spawned command line twice under Unix

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:        Mon, 16 Mar 2015 20:23:28 UTC
Commit:      dccd421a798d549b935e4dd674fa6a87e4b52ed5
             https://github.com/geany/geany/commit/dccd421a798d549b935e4dd674fa6a87e4b52ed5

Log Message:
-----------
Don't check a spawned command line twice under Unix


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

Modified: src/spawn.c
13 lines changed, 8 insertions(+), 5 deletions(-)
===================================================================
@@ -442,17 +442,20 @@ gboolean spawn_async_with_pipes(const gchar *working_directory, const gchar *com
 {
 	g_return_val_if_fail(command_line != NULL || argv != NULL, FALSE);
 
-	if (command_line && !spawn_check_command(command_line, FALSE, error))
-		return FALSE;
-
 #ifdef G_OS_WIN32
 	GString *command;
 	GArray *environment = g_array_new(TRUE, FALSE, sizeof(char));
 	GPid pid;
 	gchar *failure;
 
-	while (command_line && strchr(CL_BLANKS, *command_line))
-		command_line++;
+	if (command_line)
+	{
+		if (!spawn_check_command(command_line, FALSE, error))
+			return FALSE;
+		/* checked command line contains at least 1 non-blank */
+		while (strchr(CL_BLANKS, *command_line))
+			command_line++;
+	}
 
 	command = g_string_new(command_line);
 



--------------
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