Commit 250c575f authored by Sebastian Ramacher's avatar Sebastian Ramacher
parent dcc2e9f7
......@@ -244,26 +244,26 @@ replace_substring(const char* string, const char* old, const char* new)
GdkAtom* get_selection(zathura_t* zathura)
{
g_return_val_if_fail(zathura != NULL, NULL);
g_return_val_if_fail(zathura != NULL, NULL);
char* value;
girara_setting_get(zathura->ui.session, "selection-clipboard", &value);
char* value;
girara_setting_get(zathura->ui.session, "selection-clipboard", &value);
GdkAtom* selection = g_malloc(sizeof(GdkAtom));
GdkAtom* selection = g_malloc(sizeof(GdkAtom));
if (strcmp(value, "primary") == 0) {
*selection = GDK_SELECTION_PRIMARY;
} else if (strcmp(value, "clipboard") == 0) {
*selection = GDK_SELECTION_CLIPBOARD;
} else {
girara_error("Invalid value for the selection-clipboard setting");
g_free(value);
g_free(selection);
if (strcmp(value, "primary") == 0) {
*selection = GDK_SELECTION_PRIMARY;
} else if (strcmp(value, "clipboard") == 0) {
*selection = GDK_SELECTION_CLIPBOARD;
} else {
girara_error("Invalid value for the selection-clipboard setting");
g_free(value);
g_free(selection);
return NULL;
}
return NULL;
}
g_free(value);
g_free(value);
return selection;
return selection;
}
Markdown is supported
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