diff options
author | Bram Moolenaar <Bram@vim.org> | 2022-11-12 23:12:55 +0000 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2022-11-12 23:12:55 +0000 |
commit | 28c56d501352bd98472d23667bade683877cadcc (patch) | |
tree | ed33b5fb6bfe7cda3db747824872ccf247afb6dd /src/ex_eval.c | |
parent | 1140b51e8369fed2321ce16bd4530a0952362126 (diff) |
patch 9.0.0869: bogus error when string used after :elseifv9.0.0869
Problem: Bogus error when string used after :elseif.
Solution: Do not consider a double quote the start of a comment.
(closes #11534)
Diffstat (limited to 'src/ex_eval.c')
-rw-r--r-- | src/ex_eval.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/ex_eval.c b/src/ex_eval.c index e1c28899e1..68dc6d78ca 100644 --- a/src/ex_eval.c +++ b/src/ex_eval.c @@ -1173,7 +1173,8 @@ ex_else(exarg_T *eap) { // When skipping we ignore most errors, but a missing expression is // wrong, perhaps it should have been "else". - if (skip && ends_excmd(*eap->arg)) + // A double quote here is the start of a string, not a comment. + if (skip && *eap->arg != '"' && ends_excmd(*eap->arg)) semsg(_(e_invalid_expression_str), eap->arg); else result = eval_to_bool(eap->arg, &error, eap, skip, FALSE); |