Merge pull request #14004 from erw7/fix-fic

option: fix problem with fileignorecase not being set properly
This commit is contained in:
Jan Edmund Lazo
2021-02-25 12:45:53 -05:00
committed by GitHub
5 changed files with 8 additions and 1 deletions

View File

@@ -83,6 +83,8 @@ if(CMAKE_SYSTEM_NAME STREQUAL "Darwin")
endif() endif()
if(WIN32 OR CMAKE_SYSTEM_NAME STREQUAL "Darwin") if(WIN32 OR CMAKE_SYSTEM_NAME STREQUAL "Darwin")
# Ignore case when comparing filenames on Windows and Mac.
set(CASE_INSENSITIVE_FILENAME TRUE)
# Enable fixing case-insensitive filenames for Windows and Mac. # Enable fixing case-insensitive filenames for Windows and Mac.
set(USE_FNAME_CASE TRUE) set(USE_FNAME_CASE TRUE)
endif() endif()

View File

@@ -40,6 +40,7 @@
#cmakedefine HAVE_WORKING_LIBINTL #cmakedefine HAVE_WORKING_LIBINTL
#cmakedefine HAVE_WSL #cmakedefine HAVE_WSL
#cmakedefine UNIX #cmakedefine UNIX
#cmakedefine CASE_INSENSITIVE_FILENAME
#cmakedefine USE_FNAME_CASE #cmakedefine USE_FNAME_CASE
#cmakedefine HAVE_SYS_UIO_H #cmakedefine HAVE_SYS_UIO_H
#ifdef HAVE_SYS_UIO_H #ifdef HAVE_SYS_UIO_H

View File

@@ -5125,6 +5125,8 @@ has({feature}) Returns 1 if {feature} is supported, 0 otherwise. The
iconv Can use |iconv()| for conversion. iconv Can use |iconv()| for conversion.
+shellslash Can use backslashes in filenames (Windows) +shellslash Can use backslashes in filenames (Windows)
clipboard |clipboard| provider is available. clipboard |clipboard| provider is available.
fname_case Case in file names matters (for Darwin and MS-Windows
this is not present).
mac MacOS system. mac MacOS system.
nvim This is Nvim. nvim This is Nvim.
python2 Legacy Vim |python2| interface. |has-python| python2 Legacy Vim |python2| interface. |has-python|

View File

@@ -4131,7 +4131,9 @@ static void f_has(typval_T *argvars, typval_T *rettv, FunPtr fptr)
#ifdef _WIN64 #ifdef _WIN64
"win64", "win64",
#endif #endif
#ifndef CASE_INSENSITIVE_FILENAME
"fname_case", "fname_case",
#endif
#ifdef HAVE_ACL #ifdef HAVE_ACL
"acl", "acl",
#endif #endif

View File

@@ -342,7 +342,7 @@ int path_fnamencmp(const char *const fname1, const char *const fname2,
p1 += utfc_ptr2len((const char_u *)p1); p1 += utfc_ptr2len((const char_u *)p1);
p2 += utfc_ptr2len((const char_u *)p2); p2 += utfc_ptr2len((const char_u *)p2);
} }
return c1 - c2; return p_fic ? CH_FOLD(c1) - CH_FOLD(c2) : c1 - c2;
#else #else
if (p_fic) { if (p_fic) {
return mb_strnicmp((const char_u *)fname1, (const char_u *)fname2, len); return mb_strnicmp((const char_u *)fname1, (const char_u *)fname2, len);