Merge lp:~ted/ubuntu-app-launch/second-exec-quotes into lp:ubuntu-app-launch/14.04

Proposed by Ted Gould on 2013-12-05
Status: Merged
Approved by: Charles Kerr on 2013-12-05
Approved revision: 89
Merged at revision: 88
Proposed branch: lp:~ted/ubuntu-app-launch/second-exec-quotes
Merge into: lp:ubuntu-app-launch/14.04
Diff against target: 35 lines (+15/-8)
1 file modified
second-exec-core.c (+15/-8)
To merge this branch: bzr merge lp:~ted/ubuntu-app-launch/second-exec-quotes
Reviewer Review Type Date Requested Status
Charles Kerr (community) 2013-12-05 Approve on 2013-12-05
PS Jenkins bot (community) continuous-integration Approve on 2013-12-05
Review via email: mp+197859@code.launchpad.net

Commit message

Use the parsing of the line to split appart the URLs.

Description of the change

Use the parsing of the line to split appart the URLs.

To post a comment you must log in.
Charles Kerr (charlesk) wrote :

Confirmed that this MR WfM -- running "upstart-app-launch webbrowser-app http://www.ubuntu.com" twice from the command line as per the problem statement now works.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'second-exec-core.c'
2--- second-exec-core.c 2013-09-27 17:48:33 +0000
3+++ second-exec-core.c 2013-12-05 12:52:48 +0000
4@@ -95,16 +95,23 @@
5 return;
6 }
7
8- /* TODO: Joining only with space could cause issues with breaking them
9- back out. We don't have any cases of more than one today. But, this
10- isn't good.
11- https://bugs.launchpad.net/upstart-app-launch/+bug/1229354
12- */
13 GVariant * uris = NULL;
14- gchar ** uri_split = g_strsplit(input_uris, " ", 0);
15- if (uri_split[0] == NULL) {
16- g_free(uri_split);
17+ gchar ** uri_split = NULL;
18+ GError * error = NULL;
19+
20+ g_shell_parse_argv(input_uris, NULL, &uri_split, &error);
21+
22+ if (uri_split == NULL || uri_split[0] == NULL || error != NULL) {
23+ if (error != NULL) {
24+ g_warning("Unable to parse URLs '%s': %s", input_uris, error->message);
25+ g_error_free(error);
26+ }
27+
28 uris = g_variant_new_array(G_VARIANT_TYPE_STRING, NULL, 0);
29+
30+ if (uri_split != NULL) {
31+ g_strfreev(uri_split);
32+ }
33 } else {
34 GVariantBuilder builder;
35 g_variant_builder_init(&builder, G_VARIANT_TYPE_ARRAY);

Subscribers

People subscribed via source and target branches