diff options
author | Bram Moolenaar <Bram@vim.org> | 2009-05-13 18:48:16 +0000 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2009-05-13 18:48:16 +0000 |
commit | f1726cc8d66a0f260bb68e212d847239627789f0 (patch) | |
tree | b98b20ca7b4c09d9d1a0b1bd75894eba8a1c2e35 /src | |
parent | 5fd0ca70d31f835eefb1ee8a06b73763d761a134 (diff) | |
download | vim-git-f1726cc8d66a0f260bb68e212d847239627789f0.tar.gz |
updated for version 7.2-170v7.2.170
Diffstat (limited to 'src')
-rw-r--r-- | src/buffer.c | 13 | ||||
-rw-r--r-- | src/fileio.c | 2 | ||||
-rw-r--r-- | src/structs.h | 3 | ||||
-rw-r--r-- | src/version.c | 2 |
4 files changed, 13 insertions, 7 deletions
diff --git a/src/buffer.c b/src/buffer.c index e9243d456..4da9d6389 100644 --- a/src/buffer.c +++ b/src/buffer.c @@ -1678,9 +1678,10 @@ buflist_new(ffname, sfname, lnum, flags) buf->b_fname = buf->b_sfname; #ifdef UNIX if (st.st_dev == (dev_T)-1) - buf->b_dev = -1; + buf->b_dev_valid = FALSE; else { + buf->b_dev_valid = TRUE; buf->b_dev = st.st_dev; buf->b_ino = st.st_ino; } @@ -2693,9 +2694,10 @@ setfname(buf, ffname, sfname, message) buf->b_fname = buf->b_sfname; #ifdef UNIX if (st.st_dev == (dev_T)-1) - buf->b_dev = -1; + buf->b_dev_valid = FALSE; else { + buf->b_dev_valid = TRUE; buf->b_dev = st.st_dev; buf->b_ino = st.st_ino; } @@ -2889,7 +2891,7 @@ otherfile_buf(buf, ffname /* If no struct stat given, get it now */ if (stp == NULL) { - if (buf->b_dev < 0 || mch_stat((char *)ffname, &st) < 0) + if (!buf->b_dev_valid || mch_stat((char *)ffname, &st) < 0) st.st_dev = (dev_T)-1; stp = &st; } @@ -2926,11 +2928,12 @@ buf_setino(buf) if (buf->b_fname != NULL && mch_stat((char *)buf->b_fname, &st) >= 0) { + buf->b_dev_valid = TRUE; buf->b_dev = st.st_dev; buf->b_ino = st.st_ino; } else - buf->b_dev = -1; + buf->b_dev_valid = FALSE; } /* @@ -2941,7 +2944,7 @@ buf_same_ino(buf, stp) buf_T *buf; struct stat *stp; { - return (buf->b_dev >= 0 + return (buf->b_dev_valid && stp->st_dev == buf->b_dev && stp->st_ino == buf->b_ino); } diff --git a/src/fileio.c b/src/fileio.c index 3af64c4b0..ae656a0f1 100644 --- a/src/fileio.c +++ b/src/fileio.c @@ -4416,7 +4416,7 @@ restore_backup: # endif buf_setino(buf); } - else if (buf->b_dev < 0) + else if (!buf->b_dev_valid) /* Set the inode when creating a new file. */ buf_setino(buf); #endif diff --git a/src/structs.h b/src/structs.h index 7deb5abc4..25012d698 100644 --- a/src/structs.h +++ b/src/structs.h @@ -1166,7 +1166,8 @@ struct file_buffer char_u *b_fname; /* current file name */ #ifdef UNIX - dev_t b_dev; /* device number (-1 if not set) */ + int b_dev_valid; /* TRUE when b_dev has a valid number */ + dev_t b_dev; /* device number */ ino_t b_ino; /* inode number */ #endif #ifdef FEAT_CW_EDITOR diff --git a/src/version.c b/src/version.c index 5a38f1bab..d8be1e692 100644 --- a/src/version.c +++ b/src/version.c @@ -677,6 +677,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ /**/ + 170, +/**/ 169, /**/ 168, |