mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06:00
buf_write(): wrong argument to os_fileinfo_hardlinks
This was broken in ye olde refactor from 2014:
e85fe0957d
References #4370
This commit is contained in:
parent
e13b4a21ca
commit
9506ee0370
@ -3162,8 +3162,8 @@ nobackup:
|
|||||||
#ifdef UNIX
|
#ifdef UNIX
|
||||||
FileInfo file_info;
|
FileInfo file_info;
|
||||||
|
|
||||||
/* Don't delete the file when it's a hard or symbolic link. */
|
// Don't delete the file when it's a hard or symbolic link.
|
||||||
if ((!newfile && os_fileinfo_hardlinks(&file_info) > 1)
|
if ((!newfile && os_fileinfo_hardlinks(&file_info_old) > 1)
|
||||||
|| (os_fileinfo_link((char *)fname, &file_info)
|
|| (os_fileinfo_link((char *)fname, &file_info)
|
||||||
&& !os_fileinfo_id_equal(&file_info, &file_info_old))) {
|
&& !os_fileinfo_id_equal(&file_info, &file_info_old))) {
|
||||||
SET_ERRMSG(_("E166: Can't open linked file for writing"));
|
SET_ERRMSG(_("E166: Can't open linked file for writing"));
|
||||||
@ -4547,6 +4547,7 @@ int put_time(FILE *fd, time_t time_)
|
|||||||
///
|
///
|
||||||
/// @return -1 for failure, 0 for success
|
/// @return -1 for failure, 0 for success
|
||||||
int vim_rename(const char_u *from, const char_u *to)
|
int vim_rename(const char_u *from, const char_u *to)
|
||||||
|
FUNC_ATTR_NONNULL_ALL
|
||||||
{
|
{
|
||||||
int fd_in;
|
int fd_in;
|
||||||
int fd_out;
|
int fd_out;
|
||||||
@ -4822,6 +4823,7 @@ buf_check_timestamp (
|
|||||||
buf_T *buf,
|
buf_T *buf,
|
||||||
int focus /* called for GUI focus event */
|
int focus /* called for GUI focus event */
|
||||||
)
|
)
|
||||||
|
FUNC_ATTR_NONNULL_ALL
|
||||||
{
|
{
|
||||||
int retval = 0;
|
int retval = 0;
|
||||||
char_u *path;
|
char_u *path;
|
||||||
|
@ -131,6 +131,7 @@ bool os_isdir(const char_u *name)
|
|||||||
/// NODE_WRITABLE: writable device, socket, fifo, etc.
|
/// NODE_WRITABLE: writable device, socket, fifo, etc.
|
||||||
/// NODE_OTHER: non-writable things
|
/// NODE_OTHER: non-writable things
|
||||||
int os_nodetype(const char *name)
|
int os_nodetype(const char *name)
|
||||||
|
FUNC_ATTR_NONNULL_ALL
|
||||||
{
|
{
|
||||||
#ifdef WIN32
|
#ifdef WIN32
|
||||||
// Edge case from Vim os_win32.c:
|
// Edge case from Vim os_win32.c:
|
||||||
|
Loading…
Reference in New Issue
Block a user