]> git.pld-linux.org Git - packages/vim.git/blob - 7.2.170
- new
[packages/vim.git] / 7.2.170
1 To: vim-dev@vim.org
2 Subject: Patch 7.2.170
3 Fcc: outbox
4 From: Bram Moolenaar <Bram@moolenaar.net>
5 Mime-Version: 1.0
6 Content-Type: text/plain; charset=UTF-8
7 Content-Transfer-Encoding: 8bit
8 ------------
9
10 Patch 7.2.170
11 Problem:    Using b_dev while it was not set. (Dominique Pelle)
12 Solution:   Add the b_dev_valid flag.
13 Files:      src/buffer.c, src/fileio.c, src/structs.h
14
15
16 *** ../vim-7.2.169/src/buffer.c 2009-05-13 12:46:36.000000000 +0200
17 --- src/buffer.c        2009-05-13 20:23:51.000000000 +0200
18 ***************
19 *** 1678,1686 ****
20       buf->b_fname = buf->b_sfname;
21   #ifdef UNIX
22       if (st.st_dev == (dev_T)-1)
23 !       buf->b_dev = -1;
24       else
25       {
26         buf->b_dev = st.st_dev;
27         buf->b_ino = st.st_ino;
28       }
29 --- 1678,1687 ----
30       buf->b_fname = buf->b_sfname;
31   #ifdef UNIX
32       if (st.st_dev == (dev_T)-1)
33 !       buf->b_dev_valid = FALSE;
34       else
35       {
36 +       buf->b_dev_valid = TRUE;
37         buf->b_dev = st.st_dev;
38         buf->b_ino = st.st_ino;
39       }
40 ***************
41 *** 2693,2701 ****
42       buf->b_fname = buf->b_sfname;
43   #ifdef UNIX
44       if (st.st_dev == (dev_T)-1)
45 !       buf->b_dev = -1;
46       else
47       {
48         buf->b_dev = st.st_dev;
49         buf->b_ino = st.st_ino;
50       }
51 --- 2694,2703 ----
52       buf->b_fname = buf->b_sfname;
53   #ifdef UNIX
54       if (st.st_dev == (dev_T)-1)
55 !       buf->b_dev_valid = FALSE;
56       else
57       {
58 +       buf->b_dev_valid = TRUE;
59         buf->b_dev = st.st_dev;
60         buf->b_ino = st.st_ino;
61       }
62 ***************
63 *** 2889,2895 ****
64         /* If no struct stat given, get it now */
65         if (stp == NULL)
66         {
67 !           if (buf->b_dev < 0 || mch_stat((char *)ffname, &st) < 0)
68                 st.st_dev = (dev_T)-1;
69             stp = &st;
70         }
71 --- 2891,2897 ----
72         /* If no struct stat given, get it now */
73         if (stp == NULL)
74         {
75 !           if (!buf->b_dev_valid || mch_stat((char *)ffname, &st) < 0)
76                 st.st_dev = (dev_T)-1;
77             stp = &st;
78         }
79 ***************
80 *** 2926,2936 ****
81   
82       if (buf->b_fname != NULL && mch_stat((char *)buf->b_fname, &st) >= 0)
83       {
84         buf->b_dev = st.st_dev;
85         buf->b_ino = st.st_ino;
86       }
87       else
88 !       buf->b_dev = -1;
89   }
90   
91   /*
92 --- 2928,2939 ----
93   
94       if (buf->b_fname != NULL && mch_stat((char *)buf->b_fname, &st) >= 0)
95       {
96 +       buf->b_dev_valid = TRUE;
97         buf->b_dev = st.st_dev;
98         buf->b_ino = st.st_ino;
99       }
100       else
101 !       buf->b_dev_valid = FALSE;
102   }
103   
104   /*
105 ***************
106 *** 2941,2947 ****
107       buf_T     *buf;
108       struct stat *stp;
109   {
110 !     return (buf->b_dev >= 0
111             && stp->st_dev == buf->b_dev
112             && stp->st_ino == buf->b_ino);
113   }
114 --- 2944,2950 ----
115       buf_T     *buf;
116       struct stat *stp;
117   {
118 !     return (buf->b_dev_valid
119             && stp->st_dev == buf->b_dev
120             && stp->st_ino == buf->b_ino);
121   }
122 *** ../vim-7.2.169/src/fileio.c 2009-04-29 18:01:23.000000000 +0200
123 --- src/fileio.c        2009-05-13 20:24:08.000000000 +0200
124 ***************
125 *** 4416,4422 ****
126   # endif
127         buf_setino(buf);
128       }
129 !     else if (buf->b_dev < 0)
130         /* Set the inode when creating a new file. */
131         buf_setino(buf);
132   #endif
133 --- 4416,4422 ----
134   # endif
135         buf_setino(buf);
136       }
137 !     else if (!buf->b_dev_valid)
138         /* Set the inode when creating a new file. */
139         buf_setino(buf);
140   #endif
141 *** ../vim-7.2.169/src/structs.h        2009-05-13 18:54:14.000000000 +0200
142 --- src/structs.h       2009-05-13 20:24:54.000000000 +0200
143 ***************
144 *** 1166,1172 ****
145       char_u    *b_fname;       /* current file name */
146   
147   #ifdef UNIX
148 !     dev_t     b_dev;          /* device number (-1 if not set) */
149       ino_t     b_ino;          /* inode number */
150   #endif
151   #ifdef FEAT_CW_EDITOR
152 --- 1166,1173 ----
153       char_u    *b_fname;       /* current file name */
154   
155   #ifdef UNIX
156 !     int               b_dev_valid;    /* TRUE when b_dev has a valid number */
157 !     dev_t     b_dev;          /* device number */
158       ino_t     b_ino;          /* inode number */
159   #endif
160   #ifdef FEAT_CW_EDITOR
161 *** ../vim-7.2.169/src/version.c        2009-05-13 18:54:14.000000000 +0200
162 --- src/version.c       2009-05-13 20:43:22.000000000 +0200
163 ***************
164 *** 678,679 ****
165 --- 678,681 ----
166   {   /* Add new patch number below this line */
167 + /**/
168 +     170,
169   /**/
170
171 -- 
172 A special cleaning ordinance bans housewives from hiding dirt and dust under a
173 rug in a dwelling.
174                 [real standing law in Pennsylvania, United States of America]
175
176  /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
177 ///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
178 \\\        download, build and distribute -- http://www.A-A-P.org        ///
179  \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///
This page took 0.053553 seconds and 3 git commands to generate.