diff options
author | Lewis Russell <lewis6991@gmail.com> | 2024-06-13 22:20:06 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-06-14 05:20:06 +0800 |
commit | 43d8435cf84468e776e0a6a98d05ae7bd62583b7 (patch) | |
tree | a298243e08d6a29961464e52167d7736a875f477 /src/nvim/buffer.c | |
parent | 6589d058943405a688b9a3bba11d1869a7d318f8 (diff) | |
download | rneovim-43d8435cf84468e776e0a6a98d05ae7bd62583b7.tar.gz rneovim-43d8435cf84468e776e0a6a98d05ae7bd62583b7.tar.bz2 rneovim-43d8435cf84468e776e0a6a98d05ae7bd62583b7.zip |
revert: "refactor: use S_LEN macro" (#29319)
revert: "refactor: use S_LEN(s) instead of s, n (#29219)"
This reverts commit c37695a5d5f2e8914fff86f3581bed70b4c85d3c.
Diffstat (limited to 'src/nvim/buffer.c')
-rw-r--r-- | src/nvim/buffer.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/nvim/buffer.c b/src/nvim/buffer.c index 3f4e7047f9..57245ce3f5 100644 --- a/src/nvim/buffer.c +++ b/src/nvim/buffer.c @@ -3850,8 +3850,8 @@ static int chk_modeline(linenr_T lnum, int flags) int prev = -1; for (s = ml_get(lnum); *s != NUL; s++) { if (prev == -1 || ascii_isspace(prev)) { - if ((prev != -1 && strncmp(s, S_LEN("ex:")) == 0) - || strncmp(s, S_LEN("vi:")) == 0) { + if ((prev != -1 && strncmp(s, "ex:", 3) == 0) + || strncmp(s, "vi:", 3) == 0) { break; } // Accept both "vim" and "Vim". @@ -3867,7 +3867,7 @@ static int chk_modeline(linenr_T lnum, int flags) if (*e == ':' && (s[0] != 'V' - || strncmp(skipwhite(e + 1), S_LEN("set")) == 0) + || strncmp(skipwhite(e + 1), "set", 3) == 0) && (s[3] == ':' || (VIM_VERSION_100 >= vers && isdigit((uint8_t)s[3])) || (VIM_VERSION_100 < vers && s[3] == '<') @@ -3916,8 +3916,8 @@ static int chk_modeline(linenr_T lnum, int flags) // "vi:set opt opt opt: foo" -- foo not interpreted // "vi:opt opt opt: foo" -- foo interpreted // Accept "se" for compatibility with Elvis. - if (strncmp(s, S_LEN("set ")) == 0 - || strncmp(s, S_LEN("se ")) == 0) { + if (strncmp(s, "set ", 4) == 0 + || strncmp(s, "se ", 3) == 0) { if (*e != ':') { // no terminating ':'? break; } |