mirror of
https://git.pwmt.org/pwmt/zathura.git
synced 2024-11-10 18:03:47 +01:00
Escape path in sc_focus_inputvar with APPEND_FILEPATH (Closes: #198)
This commit is contained in:
parent
583017a836
commit
d05e40a8b5
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 New Issue
Block a user