aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/normal.c
diff options
context:
space:
mode:
authorJames McCoy <jamessan@jamessan.com>2017-03-31 07:52:45 -0400
committerGitHub <noreply@github.com>2017-03-31 07:52:45 -0400
commit77539eef9baa0d070a1d07360dda2177c2ae41a7 (patch)
treec7e9e05dc4ba6e019e38610507440a75c8945fb5 /src/nvim/normal.c
parent1097ba53f806c6f4f3e542af23332c556d38783f (diff)
parent338da727cdb19a15a0b001707e8778e10977e65c (diff)
downloadrneovim-77539eef9baa0d070a1d07360dda2177c2ae41a7.tar.gz
rneovim-77539eef9baa0d070a1d07360dda2177c2ae41a7.tar.bz2
rneovim-77539eef9baa0d070a1d07360dda2177c2ae41a7.zip
Merge pull request #6397 from jamessan/coverity
Fix latest Coverity issues
Diffstat (limited to 'src/nvim/normal.c')
-rw-r--r--src/nvim/normal.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/nvim/normal.c b/src/nvim/normal.c
index d4919dc3b6..388ddfc8bb 100644
--- a/src/nvim/normal.c
+++ b/src/nvim/normal.c
@@ -4670,6 +4670,7 @@ static void nv_ident(cmdarg_T *cap)
char_u *kp = *curbuf->b_p_kp == NUL ? p_kp : curbuf->b_p_kp; // 'keywordprg'
assert(*kp != NUL); // option.c:do_set() should default to ":help" if empty.
bool kp_ex = (*kp == ':'); // 'keywordprg' is an ex command
+ bool kp_help = (STRCMP(kp, ":he") == 0 || STRCMP(kp, ":help") == 0);
size_t buf_size = n * 2 + 30 + STRLEN(kp);
char *buf = xmalloc(buf_size);
buf[0] = NUL;
@@ -4692,7 +4693,9 @@ static void nv_ident(cmdarg_T *cap)
break;
case 'K':
- if (kp_ex) {
+ if (kp_help) {
+ STRCPY(buf, "he! ");
+ } else if (kp_ex) {
if (cap->count0 != 0) { // Send the count to the ex command.
snprintf(buf, buf_size, "%" PRId64, (int64_t)(cap->count0));
}
@@ -4755,7 +4758,7 @@ static void nv_ident(cmdarg_T *cap)
}
// Now grab the chars in the identifier
- if (cmdchar == 'K') {
+ if (cmdchar == 'K' && !kp_help) {
ptr = vim_strnsave(ptr, n);
if (kp_ex) {
// Escape the argument properly for an Ex command