[geany/geany] ac00cc: Add working directory to the "execute" test

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


Branch:      refs/heads/master
Author:      Dimitar Zhekov <dimitar.zhekov at gmail.com>
Committer:   Dimitar Zhekov <dimitar.zhekov at gmail.com>
Date:        Wed, 01 Apr 2015 18:45:25 UTC
Commit:      ac00cc0ff6b8555cfe7142579ff6f82f7d6fde3d
             https://github.com/geany/geany/commit/ac00cc0ff6b8555cfe7142579ff6f82f7d6fde3d

Log Message:
-----------
Add working directory to the "execute" test


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

Modified: src/spawn.c
8 lines changed, 6 insertions(+), 2 deletions(-)
===================================================================
@@ -1184,6 +1184,7 @@ int main(int argc, char **argv)
 
 		while (read_line("command line: ", command_line, sizeof command_line))
 		{
+			char working_directory[0x100];
 			char args[4][0x100];
 			char envs[4][0x100];
 			char *argv[] = { args[0], args[1], args[2], args[3], NULL };
@@ -1192,6 +1193,8 @@ int main(int argc, char **argv)
 			GPid pid;
 			GError *error = NULL;
 
+			read_line("working directory: ", working_directory, sizeof working_directory);
+
 			fputs("up to 4 arguments\n", stderr);
 			for (i = 0; i < 4 && read_line("argument: ", args[i], sizeof args[i]); i++);
 			argv[i] = NULL;
@@ -1200,8 +1203,9 @@ int main(int argc, char **argv)
 			for (i = 0; i < 4 && read_line("variable: ", envs[i], sizeof envs[i]); i++);
 			envp[i] = NULL;
 
-			if (spawn_async_with_pipes(NULL, *command_line ? command_line : NULL, argv,
-				i ? envp : NULL, &pid, NULL, NULL, NULL, &error))
+			if (spawn_async_with_pipes(*working_directory ? working_directory : NULL,
+				*command_line ? command_line : NULL, argv, i ? envp : NULL, &pid, NULL,
+				NULL, NULL, &error))
 			{
 				GMainLoop *loop = g_main_loop_new(NULL, TRUE);
 



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