diff options
author | Hib Eris <hib@hiberis.nl> | 2009-12-21 11:46:49 (GMT) |
---|---|---|
committer | Carlos Garcia Campos <carlosgc@gnome.org> | 2009-12-22 16:29:10 (GMT) |
commit | 9cf5791a53cbd36dc9585f0cd641eb1438f738a6 (patch) | |
tree | b9216f536609a3b386a5615e8e16c6c9e5dd2483 /backend/comics/comics-document.c | |
parent | e8587a401d8fe01cdc60b2b9fb88b14750c46a2e (diff) |
[comics] Properly quote commands
See bgo#605146.
Diffstat (limited to 'backend/comics/comics-document.c')
-rw-r--r-- | backend/comics/comics-document.c | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/backend/comics/comics-document.c b/backend/comics/comics-document.c index b82569b..8928422 100644 --- a/backend/comics/comics-document.c +++ b/backend/comics/comics-document.c @@ -186,18 +186,19 @@ comics_generate_command_lines (ComicsDocument *comics_document, GError **error) { gchar *quoted_file; + gchar *quoted_command; ComicBookDecompressType type; type = comics_document->command_usage; quoted_file = g_shell_quote (comics_document->archive); - - comics_document->extract_command = - g_strdup_printf (command_usage_def[type].extract, - comics_document->selected_command); + quoted_command = g_shell_quote (comics_document->selected_command); + + comics_document->extract_command = + g_strdup_printf (command_usage_def[type].extract, + quoted_command); comics_document->list_command = - g_strdup_printf (command_usage_def[type].list, - comics_document->selected_command, - quoted_file); + g_strdup_printf (command_usage_def[type].list, + quoted_command, quoted_file); comics_document->offset = command_usage_def[type].offset; if (command_usage_def[type].decompress_tmp) { comics_document->dir = ev_mkdtemp ("evince-comics-XXXXXX", error); @@ -208,10 +209,10 @@ comics_generate_command_lines (ComicsDocument *comics_document, comics_document->decompress_tmp = g_strdup_printf (command_usage_def[type].decompress_tmp, - comics_document->selected_command, - quoted_file, + quoted_command, quoted_file, comics_document->dir); g_free (quoted_file); + g_free (quoted_command); if (!comics_decompress_temp_dir (comics_document->decompress_tmp, comics_document->selected_command, error)) @@ -220,6 +221,7 @@ comics_generate_command_lines (ComicsDocument *comics_document, return TRUE; } else { g_free (quoted_file); + g_free (quoted_command); return TRUE; } |