aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJustin M. Keyes <justinkz@gmail.com>2016-02-22 00:48:54 -0500
committerJustin M. Keyes <justinkz@gmail.com>2016-02-22 00:48:54 -0500
commit2f98888db611891e4a814bd833dcbba42608b8cc (patch)
tree48182f6e79e84d07295c1bb7a9a3b69b454d60cb
parentf08fd412829f001f7b8ef714a05780a9fdd94eb1 (diff)
parent82293b94c33acd31c0f13e24d1913b4db2433f45 (diff)
downloadrneovim-2f98888db611891e4a814bd833dcbba42608b8cc.tar.gz
rneovim-2f98888db611891e4a814bd833dcbba42608b8cc.tar.bz2
rneovim-2f98888db611891e4a814bd833dcbba42608b8cc.zip
Merge pull request #4310 from jbradaric/vim-7.4.939
vim-patch:7.4.939
-rw-r--r--src/nvim/ex_docmd.c43
-rw-r--r--src/nvim/version.c2
2 files changed, 24 insertions, 21 deletions
diff --git a/src/nvim/ex_docmd.c b/src/nvim/ex_docmd.c
index cc03dfaf19..b1d37cfb31 100644
--- a/src/nvim/ex_docmd.c
+++ b/src/nvim/ex_docmd.c
@@ -9362,52 +9362,55 @@ static void ex_nohlsearch(exarg_T *eap)
redraw_all_later(SOME_VALID);
}
-/*
- * ":[N]match {group} {pattern}"
- * Sets nextcmd to the start of the next command, if any. Also called when
- * skipping commands to find the next command.
- */
+// ":[N]match {group} {pattern}"
+// Sets nextcmd to the start of the next command, if any. Also called when
+// skipping commands to find the next command.
static void ex_match(exarg_T *eap)
{
- char_u *p;
- char_u *g = NULL;
- char_u *end;
+ char_u *p;
+ char_u *g = NULL;
+ char_u *end;
int c;
int id;
- if (eap->line2 <= 3)
+ if (eap->line2 <= 3) {
id = eap->line2;
- else {
+ } else {
EMSG(e_invcmd);
return;
}
- /* First clear any old pattern. */
- if (!eap->skip)
- match_delete(curwin, id, FALSE);
+ // First clear any old pattern.
+ if (!eap->skip) {
+ match_delete(curwin, id, false);
+ }
- if (ends_excmd(*eap->arg))
+ if (ends_excmd(*eap->arg)) {
end = eap->arg;
- else if ((STRNICMP(eap->arg, "none", 4) == 0
- && (ascii_iswhite(eap->arg[4]) || ends_excmd(eap->arg[4]))))
+ } else if ((STRNICMP(eap->arg, "none", 4) == 0
+ && (ascii_iswhite(eap->arg[4]) || ends_excmd(eap->arg[4])))) {
end = eap->arg + 4;
- else {
+ } else {
p = skiptowhite(eap->arg);
- if (!eap->skip)
+ if (!eap->skip) {
g = vim_strnsave(eap->arg, (int)(p - eap->arg));
+ }
p = skipwhite(p);
if (*p == NUL) {
- /* There must be two arguments. */
+ // There must be two arguments.
+ xfree(g);
EMSG2(_(e_invarg2), eap->arg);
return;
}
- end = skip_regexp(p + 1, *p, TRUE, NULL);
+ end = skip_regexp(p + 1, *p, true, NULL);
if (!eap->skip) {
if (*end != NUL && !ends_excmd(*skipwhite(end + 1))) {
+ xfree(g);
eap->errmsg = e_trailing;
return;
}
if (*end != *p) {
+ xfree(g);
EMSG2(_(e_invarg2), p);
return;
}
diff --git a/src/nvim/version.c b/src/nvim/version.c
index 325fa8f567..d0ccd7e6a5 100644
--- a/src/nvim/version.c
+++ b/src/nvim/version.c
@@ -351,7 +351,7 @@ static int included_patches[] = {
// 942,
// 941,
// 940 NA
- // 939,
+ 939,
// 938 NA
// 937,
// 936,