diff options
author | Bram Moolenaar <Bram@vim.org> | 2005-02-22 08:49:11 +0000 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2005-02-22 08:49:11 +0000 |
commit | 26a60b45245080771bc2452b2634cb1f5acd60ed (patch) | |
tree | 82a54fd6544b2c2a57b5c52cb4d64c42dcd640a3 /src/syntax.c | |
parent | df177f679e950a2ab2ad5fe7d45c1daface004d7 (diff) | |
download | vim-26a60b45245080771bc2452b2634cb1f5acd60ed.zip |
updated for version 7.0051
Diffstat (limited to 'src/syntax.c')
-rw-r--r-- | src/syntax.c | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/src/syntax.c b/src/syntax.c index bf9360f47..5d08afac0 100644 --- a/src/syntax.c +++ b/src/syntax.c @@ -4397,8 +4397,19 @@ syn_cmd_keyword(eap, syncing) add_keyword(kw, syn_id, syn_opt_arg.flags, syn_opt_arg.cont_in_list, syn_opt_arg.next_list); - if (p == NULL || p[1] == NUL || p[1] == ']') + if (p == NULL) break; + if (p[1] == NUL) + { + EMSG2(_("E747: Missing ']': %s"), kw); + kw = p + 2; /* skip over the NUL */ + break; + } + if (p[1] == ']') + { + kw = p + 1; /* skip over the "]" */ + break; + } #ifdef FEAT_MBYTE if (has_mbyte) { @@ -4418,6 +4429,8 @@ syn_cmd_keyword(eap, syncing) } vim_free(keyword_copy); + vim_free(syn_opt_arg.cont_in_list); + vim_free(syn_opt_arg.next_list); } } @@ -4426,8 +4439,6 @@ syn_cmd_keyword(eap, syncing) else EMSG2(_(e_invarg2), arg); - vim_free(syn_opt_arg.cont_in_list); - vim_free(syn_opt_arg.next_list); redraw_curbuf_later(NOT_VALID); syn_stack_free_all(curbuf); /* Need to recompute all syntax. */ } |