Merge pull request #22056 from lewis6991/refactor/fileio_more

refactor `fileio.c`
This commit is contained in:
Lewis Russell 2023-02-15 16:45:20 +00:00 committed by GitHub
commit f006313e95
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 998 additions and 934 deletions

File diff suppressed because it is too large Load Diff

View File

@ -783,6 +783,7 @@ int os_setperm(const char *const name, int perm)
# ifdef HAVE_SYS_ACCESS_H
# include <sys/access.h>
# endif
#endif
// Return a pointer to the ACL of file "fname" in allocated memory.
// Return NULL if the ACL is not available for whatever reason.
@ -806,7 +807,6 @@ void os_free_acl(vim_acl_T aclent)
return;
}
}
#endif
#ifdef UNIX
/// Checks if the current user owns a file.

View File

@ -13,6 +13,12 @@
# include "nvim/os/unix_defs.h"
#endif
#ifdef BACKSLASH_IN_FILENAME
# define BACKSLASH_IN_FILENAME_BOOL true
#else
# define BACKSLASH_IN_FILENAME_BOOL false
#endif
#if !defined(NAME_MAX) && defined(_XOPEN_NAME_MAX)
# define NAME_MAX _XOPEN_NAME_MAX
#endif

View File

@ -1339,14 +1339,12 @@ write_error:
semsg(_("E829: write error in undo file: %s"), file_name);
}
#ifdef HAVE_ACL
if (buf->b_ffname != NULL) {
// For systems that support ACL: get the ACL from the original file.
vim_acl_T acl = os_get_acl(buf->b_ffname);
os_set_acl(file_name, acl);
os_free_acl(acl);
}
#endif
theend:
if (file_name != name) {