Skip to content

Commit

Permalink
geanyctags: Use stdout ctags output instead of stderr on Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
techee committed Oct 19, 2014
1 parent 212f17e commit 3a8eb42
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions geanyctags/src/geanyctags.c
Expand Up @@ -113,8 +113,9 @@ static void spawn_cmd(const gchar *cmd, const gchar *dir)
gchar *working_dir;
gchar *utf8_working_dir;
gchar *utf8_cmd_string;
gchar *err;
gchar *out, *err;
gint exitcode;
gboolean success;

#ifndef G_OS_WIN32
/* run within shell so we can use pipes */
Expand All @@ -139,9 +140,13 @@ 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);

if (!utils_spawn_sync(working_dir, argv, NULL, G_SPAWN_SEARCH_PATH,
NULL, NULL, NULL, &err, &exitcode, &error) || exitcode != 0)

success = utils_spawn_sync(working_dir, argv, NULL, G_SPAWN_SEARCH_PATH,
NULL, NULL, &out, &err, &exitcode, &error);
#ifdef G_OS_WIN32
err = out;

This comment has been minimized.

Copy link
@b4n

b4n Oct 19, 2014

Member

isn't this gonna leak memory, at least if the program did output something on stderr?
Also, on non-Win32 I don't see the g_free() call on out :)

This comment has been minimized.

Copy link
@techee

techee via email Oct 19, 2014

Author Member

This comment has been minimized.

Copy link
@techee

techee Oct 19, 2014

Author Member

Fixed I hope.

This comment has been minimized.

Copy link
@b4n

b4n Oct 19, 2014

Member

looks like it :)

#endif
if (!success || exitcode != 0)
{
if (error != NULL)
{
Expand Down

0 comments on commit 3a8eb42

Please sign in to comment.