aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbfredl <bjorn.linse@gmail.com>2024-10-11 20:25:35 +0200
committerbfredl <bjorn.linse@gmail.com>2024-10-11 20:26:54 +0200
commit486076a0e1ee3c7bb230e0f95a21607fadea96d4 (patch)
tree2a1c2cb5d2d098553e28a2c90ebd5a5486ffd631
parent26e765f905cbf1df18cfc825bad9b1b982f517ea (diff)
downloadrneovim-486076a0e1ee3c7bb230e0f95a21607fadea96d4.tar.gz
rneovim-486076a0e1ee3c7bb230e0f95a21607fadea96d4.tar.bz2
rneovim-486076a0e1ee3c7bb230e0f95a21607fadea96d4.zip
fix(build): remove USE_FNAME_CASE, redundant with CASE_INSENSITIVE_FILENAME
It stands to reason, you need to "fix" case-insensitive filenames if-and-only-if you have case-insensitive filenames.
-rw-r--r--CMakeLists.txt4
-rw-r--r--cmake.config/config.h.in1
-rw-r--r--src/nvim/buffer.c2
-rw-r--r--src/nvim/ex_cmds.c2
-rw-r--r--src/nvim/main.c2
-rw-r--r--src/nvim/path.c2
-rw-r--r--test/old/testdir/test_edit.vim2
7 files changed, 6 insertions, 9 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 0100146274..f6c5427c7d 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -111,10 +111,8 @@ if(APPLE)
endif()
if(WIN32 OR APPLE)
- # Ignore case when comparing filenames on Windows and Mac.
+ # Handle case-insensitive filenames for Windows and Mac.
set(CASE_INSENSITIVE_FILENAME TRUE)
- # Enable fixing case-insensitive filenames for Windows and Mac.
- set(USE_FNAME_CASE TRUE)
endif()
if (MINGW)
diff --git a/cmake.config/config.h.in b/cmake.config/config.h.in
index af4e13fc11..fd712032c3 100644
--- a/cmake.config/config.h.in
+++ b/cmake.config/config.h.in
@@ -34,7 +34,6 @@
#cmakedefine HAVE_WORKING_LIBINTL
#cmakedefine UNIX
#cmakedefine CASE_INSENSITIVE_FILENAME
-#cmakedefine USE_FNAME_CASE
#cmakedefine HAVE_SYS_UIO_H
#ifdef HAVE_SYS_UIO_H
#cmakedefine HAVE_READV
diff --git a/src/nvim/buffer.c b/src/nvim/buffer.c
index 4a87cebfa7..ce47705aa6 100644
--- a/src/nvim/buffer.c
+++ b/src/nvim/buffer.c
@@ -2985,7 +2985,7 @@ int setfname(buf_T *buf, char *ffname_arg, char *sfname_arg, bool message)
close_buffer(NULL, obuf, DOBUF_WIPE, false, false);
}
sfname = xstrdup(sfname);
-#ifdef USE_FNAME_CASE
+#ifdef CASE_INSENSITIVE_FILENAME
path_fix_case(sfname); // set correct case for short file name
#endif
if (buf->b_sfname != buf->b_ffname) {
diff --git a/src/nvim/ex_cmds.c b/src/nvim/ex_cmds.c
index a98de05815..d48d25fc22 100644
--- a/src/nvim/ex_cmds.c
+++ b/src/nvim/ex_cmds.c
@@ -2134,7 +2134,7 @@ int do_ecmd(int fnum, char *ffname, char *sfname, exarg_T *eap, linenr_T newlnum
if (sfname == NULL) {
sfname = ffname;
}
-#ifdef USE_FNAME_CASE
+#ifdef CASE_INSENSITIVE_FILENAME
if (sfname != NULL) {
path_fix_case(sfname); // set correct case for sfname
}
diff --git a/src/nvim/main.c b/src/nvim/main.c
index dc102f6f6d..b54b2a531a 100644
--- a/src/nvim/main.c
+++ b/src/nvim/main.c
@@ -1448,7 +1448,7 @@ scripterror:
p = r;
}
-#ifdef USE_FNAME_CASE
+#ifdef CASE_INSENSITIVE_FILENAME
// Make the case of the file name match the actual file.
path_fix_case(p);
#endif
diff --git a/src/nvim/path.c b/src/nvim/path.c
index 9cce504831..4c16adde4c 100644
--- a/src/nvim/path.c
+++ b/src/nvim/path.c
@@ -1827,7 +1827,7 @@ char *fix_fname(const char *fname)
fname = xstrdup(fname);
-# ifdef USE_FNAME_CASE
+# ifdef CASE_INSENSITIVE_FILENAME
path_fix_case((char *)fname); // set correct case for file name
# endif
diff --git a/test/old/testdir/test_edit.vim b/test/old/testdir/test_edit.vim
index 037282bf1a..9114cf8b11 100644
--- a/test/old/testdir/test_edit.vim
+++ b/test/old/testdir/test_edit.vim
@@ -2035,7 +2035,7 @@ func Test_edit_browse()
au!
augroup END
- " When the USE_FNAME_CASE is defined this used to cause a crash.
+ " When the CASE_INSENSITIVE_FILENAME is defined this used to cause a crash.
browse enew
bwipe!