mirror of
https://git.pwmt.org/pwmt/zathura.git
synced 2024-12-26 21:46:02 +01:00
Fixed some quoating issues
Thanks to Sebastinas
This commit is contained in:
parent
68fc126c8a
commit
56284b9fd1
2 changed files with 8 additions and 5 deletions
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue