aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/file_search.c
diff options
context:
space:
mode:
authorLewis Russell <lewis6991@gmail.com>2024-06-13 22:20:06 +0100
committerGitHub <noreply@github.com>2024-06-14 05:20:06 +0800
commit43d8435cf84468e776e0a6a98d05ae7bd62583b7 (patch)
treea298243e08d6a29961464e52167d7736a875f477 /src/nvim/file_search.c
parent6589d058943405a688b9a3bba11d1869a7d318f8 (diff)
downloadrneovim-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/file_search.c')
-rw-r--r--src/nvim/file_search.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/nvim/file_search.c b/src/nvim/file_search.c
index 50031eedee..b6a039af5e 100644
--- a/src/nvim/file_search.c
+++ b/src/nvim/file_search.c
@@ -399,7 +399,7 @@ void *vim_findfile_init(char *path, char *filename, char *stopdirs, int level, i
emsg(_(e_path_too_long_for_completion));
break;
}
- if (strncmp(wc_part, S_LEN("**")) == 0) {
+ if (strncmp(wc_part, "**", 2) == 0) {
ff_expand_buffer[len++] = *wc_part++;
ff_expand_buffer[len++] = *wc_part++;
@@ -462,7 +462,7 @@ void *vim_findfile_init(char *path, char *filename, char *stopdirs, int level, i
if (p > search_ctx->ffsc_fix_path) {
// do not add '..' to the path and start upwards searching
len = (int)(p - search_ctx->ffsc_fix_path) - 1;
- if ((len >= 2 && strncmp(search_ctx->ffsc_fix_path, S_LEN("..")) == 0)
+ if ((len >= 2 && strncmp(search_ctx->ffsc_fix_path, "..", 2) == 0)
&& (len == 2 || search_ctx->ffsc_fix_path[2] == PATHSEP)) {
xfree(buf);
goto error_return;
@@ -690,7 +690,7 @@ char *vim_findfile(void *search_ctx_arg)
rest_of_wildcards = stackp->ffs_wc_path;
if (*rest_of_wildcards != NUL) {
len = strlen(file_path);
- if (strncmp(rest_of_wildcards, S_LEN("**")) == 0) {
+ if (strncmp(rest_of_wildcards, "**", 2) == 0) {
// pointer to the restrict byte
// The restrict byte is not a character!
p = rest_of_wildcards + 2;
@@ -867,7 +867,7 @@ char *vim_findfile(void *search_ctx_arg)
// if wildcards contains '**' we have to descent till we reach the
// leaves of the directory tree.
- if (strncmp(stackp->ffs_wc_path, S_LEN("**")) == 0) {
+ if (strncmp(stackp->ffs_wc_path, "**", 2) == 0) {
for (int i = stackp->ffs_filearray_cur;
i < stackp->ffs_filearray_size; i++) {
if (path_fnamecmp(stackp->ffs_filearray[i],