diff options
author | David King <amigadave@amigadave.com> | 2015-02-09 21:05:57 +0000 |
---|---|---|
committer | David King <amigadave@amigadave.com> | 2015-02-09 23:24:05 +0000 |
commit | 34af790e87fdfb9e7340b4b6591104945b4e632d (patch) | |
tree | ccd7a782f7c7892ba857f15e685cadfd0b126014 /libyelp/yelp-uri.c | |
parent | 6753f261bc9b235c3588583213f6b2799a52b3ba (diff) | |
download | yelp-34af790e87fdfb9e7340b4b6591104945b4e632d.tar.gz |
Fix warnings about discarding const
Diffstat (limited to 'libyelp/yelp-uri.c')
-rw-r--r-- | libyelp/yelp-uri.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/libyelp/yelp-uri.c b/libyelp/yelp-uri.c index e139c1ab..8d155615 100644 --- a/libyelp/yelp-uri.c +++ b/libyelp/yelp-uri.c @@ -917,7 +917,7 @@ resolve_help_list_uri (YelpUri *uri) static gchar* find_man_path (gchar* name, gchar* section) { - gchar* argv[] = { "man", "-w", NULL, NULL, NULL }; + gchar* argv[] = { g_strdup ("man"), g_strdup ("-w"), NULL, NULL, NULL }; gchar *ystdout = NULL; gint status; gchar **lines; @@ -926,10 +926,10 @@ find_man_path (gchar* name, gchar* section) /* Syntax for man is "man -w <section> <name>", possibly omitting section */ if (section) { - argv[2] = section; - argv[3] = name; + argv[2] = g_strdup (section); + argv[3] = g_strdup (name); } else { - argv[2] = name; + argv[2] = g_strdup (name); } if (!g_spawn_sync (NULL, argv, NULL, @@ -941,6 +941,8 @@ find_man_path (gchar* name, gchar* section) g_error_free (error); } + g_strfreev (argv); + if (status == 0) { lines = g_strsplit (ystdout, "\n", 2); g_free (ystdout); |