aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/nvim/ex_docmd.c3
-rw-r--r--src/nvim/syntax.c4
2 files changed, 4 insertions, 3 deletions
diff --git a/src/nvim/ex_docmd.c b/src/nvim/ex_docmd.c
index 134def0c2c..3e9b889253 100644
--- a/src/nvim/ex_docmd.c
+++ b/src/nvim/ex_docmd.c
@@ -31,6 +31,7 @@
#include "nvim/ex_getln.h"
#include "nvim/fileio.h"
#include "nvim/fold.h"
+#include "nvim/func_attr.h"
#include "nvim/getchar.h"
#include "nvim/hardcopy.h"
#include "nvim/if_cscope.h"
@@ -4025,7 +4026,7 @@ static void ex_blast(exarg_T *eap)
goto_buffer(eap, DOBUF_LAST, BACKWARD, 0);
}
-int ends_excmd(int c)
+int ends_excmd(int c) FUNC_ATTR_CONST
{
return c == NUL || c == '|' || c == '"' || c == '\n';
}
diff --git a/src/nvim/syntax.c b/src/nvim/syntax.c
index 4a3ab46e75..6c5c0f37b1 100644
--- a/src/nvim/syntax.c
+++ b/src/nvim/syntax.c
@@ -5106,7 +5106,7 @@ get_id_list (
* parse the arguments after "contains"
*/
count = 0;
- while (!ends_excmd(*p)) {
+ do {
for (end = p; *end && !vim_iswhite(*end) && *end != ','; ++end)
;
name = xmalloc((int)(end - p + 3)); /* leave room for "^$" */
@@ -5199,7 +5199,7 @@ get_id_list (
if (*p != ',')
break;
p = skipwhite(p + 1); /* skip comma in between arguments */
- }
+ } while (!ends_excmd(*p));
if (failed)
break;
if (round == 1) {