summaryrefslogtreecommitdiff
path: root/src/fileio.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2006-02-28 23:52:23 +0000
committerBram Moolenaar <Bram@vim.org>2006-02-28 23:52:23 +0000
commit03f4855fc252dd389622715dd56cbc49423057ba (patch)
treec012f29a3c1c0f89b959e1a73105eda82afc4060 /src/fileio.c
parentb388adb1887c50d351cff7d15227e837303a64cb (diff)
downloadvim-git-03f4855fc252dd389622715dd56cbc49423057ba.tar.gz
updated for version 7.0210
Diffstat (limited to 'src/fileio.c')
-rw-r--r--src/fileio.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/src/fileio.c b/src/fileio.c
index c3ff07c47..508de0bc1 100644
--- a/src/fileio.c
+++ b/src/fileio.c
@@ -2357,6 +2357,22 @@ failed:
curbuf->b_op_start.col = 0;
curbuf->b_op_end.lnum = from + linecnt;
curbuf->b_op_end.col = 0;
+
+#ifdef WIN32
+ /*
+ * Work around a weird problem: When a file has two links (only
+ * possible on NTFS) and we write through one link, then stat() it
+ * throught the other link, the timestamp information may be wrong.
+ * It's correct again after reading the file, thus reset the timestamp
+ * here.
+ */
+ if (newfile && !read_stdin && !read_buffer
+ && mch_stat((char *)fname, &st) >= 0)
+ {
+ buf_store_time(curbuf, &st, fname);
+ curbuf->b_mtime_read = curbuf->b_mtime;
+ }
+#endif
}
msg_scroll = msg_save;
@@ -3263,6 +3279,13 @@ buf_write(buf, fname, sfname, start, end, eap, append, forceit,
)
backup_copy = TRUE;
else
+# else
+# ifdef WIN32
+ /* On NTFS file systems hard links are possible. */
+ if (mch_is_linked(fname))
+ backup_copy = TRUE;
+ else
+# endif
# endif
{
/*