Signed-off-by: Sebastian Ramacher <sebastian+dev@ramacher.at>
This commit is contained in:
Sebastian Ramacher 2014-01-05 23:05:43 +01:00
parent dcc2e9f736
commit 250c575f44

34
utils.c
View File

@ -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));
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;
}
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);
return selection;
return NULL;
}
g_free(value);
return selection;
}