mirror of
https://git.pwmt.org/pwmt/zathura.git
synced 2024-12-29 13:16:00 +01:00
Escape path in sc_focus_inputvar with APPEND_FILEPATH (Closes: #198)
This commit is contained in:
parent
583017a836
commit
d05e40a8b5
1 changed files with 5 additions and 7 deletions
12
shortcuts.c
12
shortcuts.c
|
@ -6,7 +6,6 @@
|
|||
#include <girara/shortcuts.h>
|
||||
#include <girara/utils.h>
|
||||
#include <gtk/gtk.h>
|
||||
#include <libgen.h>
|
||||
#include <glib/gi18n.h>
|
||||
|
||||
#include "callbacks.h"
|
||||
|
@ -186,12 +185,11 @@ sc_focus_inputbar(girara_session_t* session, girara_argument_t* argument, girara
|
|||
return false;
|
||||
}
|
||||
|
||||
char* path = dirname(g_strdup(file_path));
|
||||
char* tmp = g_strdup_printf("%s%s/", (char*) argument->data, (g_strcmp0(path, "/") == 0) ? "" : path);
|
||||
|
||||
if (tmp == NULL) {
|
||||
return false;
|
||||
}
|
||||
char* path = g_path_get_dirname(file_path);
|
||||
char* escaped = girara_escape_string(path);
|
||||
char* tmp = g_strdup_printf("%s%s/", (char*) argument->data, (g_strcmp0(path, "/") == 0) ? "" : escaped);
|
||||
g_free(path);
|
||||
g_free(escaped);
|
||||
|
||||
gtk_entry_set_text(session->gtk.inputbar_entry, tmp);
|
||||
g_free(tmp);
|
||||
|
|
Loading…
Reference in a new issue