From: Daniel Carl Date: Tue, 3 Jun 2014 12:13:18 +0000 (+0200) Subject: Fixed segfault on yank without buffer. X-Git-Url: https://git.owens.tech/assets/static/git-logo.png/assets/static/git-logo.png/git?a=commitdiff_plain;h=89e1fdda6cc4432e2491f27468718ad2fd17a1a7;p=vimb.git Fixed segfault on yank without buffer. --- diff --git a/src/command.c b/src/command.c index cdf0404..88a9c70 100644 --- a/src/command.c +++ b/src/command.c @@ -102,9 +102,7 @@ gboolean command_yank(const Arg *arg, char buf) } if (text) { /* put the text into the yank buffer */ - if (strchr(VB_USER_REG, buf)) { - vb_register_add(buf, text); - } + vb_register_add(buf, text); vb_echo(VB_MSG_NORMAL, false, tmpl, text); g_free(text); @@ -125,9 +123,7 @@ gboolean command_yank(const Arg *arg, char buf) if (a.s) { /* put the text into the yank buffer */ vb_set_clipboard(&a); - if (strchr(VB_USER_REG, buf)) { - vb_register_add(buf, a.s); - } + vb_register_add(buf, a.s); vb_echo(VB_MSG_NORMAL, false, tmpl, a.s); return true; diff --git a/src/main.c b/src/main.c index 076a6ad..ac44a25 100644 --- a/src/main.c +++ b/src/main.c @@ -984,7 +984,7 @@ void vb_register_add(char buf, const char *value) char *mark; int idx; - if (!vb.state.enable_register) { + if (!vb.state.enable_register || !buf) { return; }