diff options
author | Scott Prager <splinterofchaos@gmail.com> | 2014-09-20 22:39:31 -0400 |
---|---|---|
committer | Thiago de Arruda <tpadilha84@gmail.com> | 2015-03-31 11:20:23 -0300 |
commit | 0f4976687d0dfc3a0992195219586be93e49dc9e (patch) | |
tree | 7869a4aa3cb88f79cdc75d4282673b230088a6f0 /src/nvim/os_unix.c | |
parent | 24da0d49d0a0e576fed6cbd699e40380d5c31322 (diff) | |
download | rneovim-0f4976687d0dfc3a0992195219586be93e49dc9e.tar.gz rneovim-0f4976687d0dfc3a0992195219586be93e49dc9e.tar.bz2 rneovim-0f4976687d0dfc3a0992195219586be93e49dc9e.zip |
os_scandir: fname_case -> path_fix_case
Use os_scandir().
fname_case() only gets used when `defined(USE_FNAME_CASE)` (on operating
systems with case-insensitive file systems), but may be useful in other
contexts, so move it to path.c. (See the TODO.)
Remove the unused parameter, len.
Diffstat (limited to 'src/nvim/os_unix.c')
-rw-r--r-- | src/nvim/os_unix.c | 56 |
1 files changed, 0 insertions, 56 deletions
diff --git a/src/nvim/os_unix.c b/src/nvim/os_unix.c index 82a43499b4..70cafc62ca 100644 --- a/src/nvim/os_unix.c +++ b/src/nvim/os_unix.c @@ -69,62 +69,6 @@ static int selinux_enabled = -1; # include "os_unix.c.generated.h" #endif -#if defined(USE_FNAME_CASE) -/* - * Set the case of the file name, if it already exists. This will cause the - * file name to remain exactly the same. - * Only required for file systems where case is ignored and preserved. - */ -void fname_case( -char_u *name, -int len /* buffer size, only used when name gets longer */ -) -{ - char_u *slash, *tail; - DIR *dirp; - struct dirent *dp; - - FileInfo file_info; - if (os_fileinfo_link((char *)name, &file_info)) { - /* Open the directory where the file is located. */ - slash = vim_strrchr(name, '/'); - if (slash == NULL) { - dirp = opendir("."); - tail = name; - } else { - *slash = NUL; - dirp = opendir((char *)name); - *slash = '/'; - tail = slash + 1; - } - - if (dirp != NULL) { - while ((dp = readdir(dirp)) != NULL) { - /* Only accept names that differ in case and are the same byte - * length. TODO: accept different length name. */ - if (STRICMP(tail, dp->d_name) == 0 - && STRLEN(tail) == STRLEN(dp->d_name)) { - char_u newname[MAXPATHL + 1]; - - /* Verify the inode is equal. */ - STRLCPY(newname, name, MAXPATHL + 1); - STRLCPY(newname + (tail - name), dp->d_name, - MAXPATHL - (tail - name) + 1); - FileInfo file_info_new; - if (os_fileinfo_link((char *)newname, &file_info_new) - && os_fileinfo_id_equal(&file_info, &file_info_new)) { - STRCPY(tail, dp->d_name); - break; - } - } - } - - closedir(dirp); - } - } -} -#endif - #if defined(HAVE_ACL) # ifdef HAVE_SYS_ACL_H # include <sys/acl.h> |