aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/help.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/nvim/help.c')
-rw-r--r--src/nvim/help.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/nvim/help.c b/src/nvim/help.c
index e9f67ca3e4..6ba3e17e0b 100644
--- a/src/nvim/help.c
+++ b/src/nvim/help.c
@@ -13,6 +13,7 @@
#include "nvim/charset.h"
#include "nvim/cmdexpand.h"
#include "nvim/cmdexpand_defs.h"
+#include "nvim/errors.h"
#include "nvim/ex_cmds.h"
#include "nvim/ex_cmds_defs.h"
#include "nvim/ex_docmd.h"
@@ -654,7 +655,7 @@ void get_local_additions(void)
// files. This uses the very first line in the help file.
char *const fname = path_tail(curbuf->b_fname);
if (path_fnamecmp(fname, "help.txt") == 0
- || (path_fnamencmp(fname, "help.", 5) == 0
+ || (path_fnamencmp(fname, S_LEN("help.")) == 0
&& ASCII_ISALPHA(fname[5])
&& ASCII_ISALPHA(fname[6])
&& TOLOWER_ASC(fname[7]) == 'x'
@@ -957,8 +958,8 @@ static void helptags_one(char *dir, const char *ext, const char *tagfname, bool
if (s == p2
&& (p1 == IObuff || p1[-1] == ' ' || p1[-1] == '\t')
&& (vim_strchr(" \t\n\r", (uint8_t)s[1]) != NULL
- || s[1] == '\0')) {
- *p2 = '\0';
+ || s[1] == NUL)) {
+ *p2 = NUL;
p1++;
size_t s_len = (size_t)(p2 - p1) + strlen(fname) + 2;
s = xmalloc(s_len);
@@ -1014,7 +1015,7 @@ static void helptags_one(char *dir, const char *ext, const char *tagfname, bool
// Write the tags into the file.
for (int i = 0; i < ga.ga_len; i++) {
s = ((char **)ga.ga_data)[i];
- if (strncmp(s, "help-tags\t", 10) == 0) {
+ if (strncmp(s, S_LEN("help-tags\t")) == 0) {
// help-tags entry was added in formatted form
fputs(s, fd_tags);
} else {
@@ -1148,7 +1149,7 @@ void ex_helptags(exarg_T *eap)
bool add_help_tags = false;
// Check for ":helptags ++t {dir}".
- if (strncmp(eap->arg, "++t", 3) == 0 && ascii_iswhite(eap->arg[3])) {
+ if (strncmp(eap->arg, S_LEN("++t")) == 0 && ascii_iswhite(eap->arg[3])) {
add_help_tags = true;
eap->arg = skipwhite(eap->arg + 3);
}