Commit 56284b9f authored by Moritz Lipp's avatar Moritz Lipp
Browse files

Fixed some quoating issues

Thanks to Sebastinas
parent 68fc126c
......@@ -52,10 +52,10 @@ char* default_text = "[No Name]";
/* printing */
char* list_printer_command = "lpstat -v | sed -n '/^.*device for \\(.*\\): .*$/s//\\1/p'";
char* print_command = "lp -d '%s' -P %s %s '%s'"; /* printer / pages / file */
char* print_command = "lp -d '%s' -P %s %s %s"; /* printer / pages / file */
/* open uri */
char* uri_command = "firefox '%s'"; /* uri */
char* uri_command = "firefox %s"; /* uri */
/* additional settings */
gboolean show_scrollbars = FALSE;
......
......@@ -1341,7 +1341,7 @@ open_file(char* path, char* password)
void open_uri(char* uri)
{
char* escaped_uri = g_strescape(uri, NULL);
char* escaped_uri = g_shell_quote(uri);
char* uri_cmd = g_strdup_printf(uri_command, escaped_uri);
system(uri_cmd);
g_free(uri_cmd);
......@@ -3301,13 +3301,16 @@ cmd_print(int argc, char** argv)
addit = g_string_append(addit, argv[i]);
}
char* escaped_filename = g_strescape(Zathura.PDF.file, NULL);
char* command = g_strdup_printf(print_command, printer, sites, addit->str, escaped_filename);
char* escaped_filename = g_shell_quote(Zathura.PDF.file);
char* escaped_addit = g_shell_quote(addit->str);
char* command = g_strdup_printf(print_command, printer, sites, escaped_addit, escaped_filename);
system(command);
g_free(sites);
g_free(escaped_filename);
g_free(escaped_addit);
g_free(command);
g_string_free(addit, TRUE);
return TRUE;
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment