[geany/geany-plugins] 3b9abb: Merge branch 'geanyctags_fix_spawn_win32' of https://github.com/eht16/geany-plugins

Jiří Techet git-noreply at xxxxx
Sun Mar 6 17:40:01 UTC 2016


Branch:      refs/heads/master
Author:      Jiří Techet <techet at gmail.com>
Committer:   Jiří Techet <techet at gmail.com>
Date:        Sun, 06 Mar 2016 17:40:01 UTC
Commit:      3b9abb1ea19a0135aeadc8a2f108cc176faae2e3
             https://github.com/geany/geany-plugins/commit/3b9abb1ea19a0135aeadc8a2f108cc176faae2e3

Log Message:
-----------
Merge branch 'geanyctags_fix_spawn_win32' of https://github.com/eht16/geany-plugins

Conflicts:
	geanyctags/src/geanyctags.c


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

Modified: geanyctags/src/geanyctags.c
24 lines changed, 11 insertions(+), 13 deletions(-)
===================================================================
@@ -46,7 +46,7 @@
 #endif
 
 
-PLUGIN_VERSION_CHECK(224)
+PLUGIN_VERSION_CHECK(226)
 PLUGIN_SET_TRANSLATABLE_INFO(LOCALEDIR, GETTEXT_PACKAGE,
 	"GeanyCtags",
 	_("Ctags generation and search plugin for geany projects"),
@@ -118,13 +118,14 @@ void plugin_help (void)
 static void spawn_cmd(const gchar *cmd, const gchar *dir)
 {
 	GError *error = NULL;
-	gchar **argv;
+	gchar **argv = NULL;
 	gchar *working_dir;
 	gchar *utf8_working_dir;
 	gchar *utf8_cmd_string;
 	gchar *out;
 	gint exitcode;
 	gboolean success;
+	GString *output;
 
 #ifndef G_OS_WIN32
 	/* run within shell so we can use pipes */
@@ -133,13 +134,8 @@ static void spawn_cmd(const gchar *cmd, const gchar *dir)
 	argv[1] = g_strdup("-c");
 	argv[2] = g_strdup(cmd);
 	argv[3] = NULL;
-#else
-	/* no shell on windows */
-	argv = g_new0(gchar *, 2);
-	argv[0] = g_strdup(cmd);
-	argv[1] = NULL;
 #endif
-			
+
 	utf8_cmd_string = utils_get_utf8_from_locale(cmd);
 	utf8_working_dir = g_strdup(dir);
 	working_dir = utils_get_locale_from_utf8(utf8_working_dir);
@@ -149,14 +145,16 @@ static void spawn_cmd(const gchar *cmd, const gchar *dir)
 	msgwin_msg_add(COLOR_BLUE, -1, NULL, _("%s (in directory: %s)"), utf8_cmd_string, utf8_working_dir);
 	g_free(utf8_working_dir);
 	g_free(utf8_cmd_string);
-	
+
+	output = g_string_new(NULL);
 #ifndef G_OS_WIN32
-	success = utils_spawn_sync(working_dir, argv, NULL, G_SPAWN_SEARCH_PATH,
-			NULL, NULL, NULL, &out, &exitcode, &error);
+	success = spawn_sync(working_dir, NULL, argv, NULL,
+			NULL, NULL, output, &exitcode, &error);
 #else
-	success = utils_spawn_sync(working_dir, argv, NULL, G_SPAWN_SEARCH_PATH,
-			NULL, NULL, &out, NULL, &exitcode, &error);
+	success = spawn_sync(working_dir, cmd, NULL, NULL,
+			NULL, output, NULL, &exitcode, &error);
 #endif
+	out = g_string_free(output, FALSE);
 	if (!success || exitcode != 0)
 	{
 		if (error != NULL)



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


More information about the Plugins-Commits mailing list