summaryrefslogtreecommitdiff
path: root/libyelp/yelp-man-parser.c
diff options
context:
space:
mode:
Diffstat (limited to 'libyelp/yelp-man-parser.c')
-rw-r--r--libyelp/yelp-man-parser.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/libyelp/yelp-man-parser.c b/libyelp/yelp-man-parser.c
index a3f97a62..eb2fcb40 100644
--- a/libyelp/yelp-man-parser.c
+++ b/libyelp/yelp-man-parser.c
@@ -369,9 +369,8 @@ get_troff (gchar *path, GError **error)
{
gint ystdout;
GError *err = NULL;
- gchar *argv[] = { "man", "-Z", "-Tutf8", "-EUTF-8", NULL, NULL };
-
- argv[4] = path;
+ gchar *argv[] = { g_strdup ("man"), g_strdup ("-Z"), g_strdup ("-Tutf8"),
+ g_strdup ("-EUTF-8"), g_strdup (path), NULL };
if (!g_spawn_async_with_pipes (NULL, argv, NULL,
G_SPAWN_SEARCH_PATH, NULL, NULL,
@@ -380,9 +379,12 @@ get_troff (gchar *path, GError **error)
*error = g_error_new (YELP_ERROR, YELP_ERROR_UNKNOWN,
"%s", err->message);
g_error_free (err);
+ g_strfreev (argv);
return NULL;
}
+ g_strfreev (argv);
+
return (GInputStream*) g_unix_input_stream_new (ystdout, TRUE);
}