4 From: Bram Moolenaar <Bram@moolenaar.net>
6 Content-Type: text/plain; charset=ISO-8859-1
7 Content-Transfer-Encoding: 8bit
10 Patch 7.0.208 (after 7.0.171 and 7.0.180)
11 Problem: VMS: changes to path handling cause more trouble than they solve.
12 Solution: Revert changes.
13 Files: src/buffer.c, src/memline.c, src/os_unix.c
16 *** ../vim-7.0.207/src/buffer.c Tue Nov 28 17:44:51 2006
17 --- src/buffer.c Mon Mar 5 21:34:41 2007
21 * Force expanding the path always for Unix, because symbolic links may
22 * mess up the full path name, even though it starts with a '/'.
23 - * Also expand always for VMS, it may have alternate paths that need to be
25 * Also expand when there is ".." in the file name, try to remove it,
26 * because "c:/src/../README" is equal to "c:/README".
27 * For MS-Windows also expand names like "longna~1" to "longname".
29 ! #if defined(UNIX) || defined(VMS)
30 return FullName_save(fname, TRUE);
32 if (!vim_isAbsName(fname) || strstr((char *)fname, "..") != NULL
35 * Force expanding the path always for Unix, because symbolic links may
36 * mess up the full path name, even though it starts with a '/'.
37 * Also expand when there is ".." in the file name, try to remove it,
38 * because "c:/src/../README" is equal to "c:/README".
39 * For MS-Windows also expand names like "longna~1" to "longname".
42 return FullName_save(fname, TRUE);
44 if (!vim_isAbsName(fname) || strstr((char *)fname, "..") != NULL
45 *** ../vim-7.0.207/src/memline.c Tue Feb 13 04:03:05 2007
46 --- src/memline.c Mon Mar 5 21:34:41 2007
50 (buf->b_p_sn || buf->b_shortname),
52 ! #if defined(VMS) || defined(RISCOS)
53 ! /* Avoid problems if fname has special chars, eg <Wimp$Scrap>.
54 ! * For VMS always use full path for swapfile. */
60 (buf->b_p_sn || buf->b_shortname),
63 ! /* Avoid problems if fname has special chars, eg <Wimp$Scrap> */
67 *** ../vim-7.0.207/src/os_unix.c Tue Feb 27 16:51:07 2007
68 --- src/os_unix.c Mon Mar 5 21:40:31 2007
72 int force; /* also expand when already absolute path */
76 - * VMS does this in a completely different way.
78 - * By default a file found in a complex path is written to the first
79 - * directory in the path and not to the original directory. This
80 - * behaviour should be avoided for the existing files and we need to find
81 - * the exact path of the edited file.
84 - char_u *fixed_fname = vms_fixfilename(fname);
85 - int fd = mch_open((char *)fixed_fname, O_RDONLY | O_EXTRA, 0);
89 - char nbuf[MAXNAMLEN];
91 - /* File exists, use getname() to get the real name. */
92 - if (getname(fd, nbuf))
93 - vim_strncpy(fixed_fname, (char_u *)nbuf, (size_t)(len - 1));
97 - if (STRLEN(fixed_fname) >= len)
100 - STRCPY(buf, fixed_fname);
103 - #else /* not VMS */
107 int only_drive; /* file name is only a drive letter */
109 ! # ifdef HAVE_FCHDIR
111 static int dont_fchdir = FALSE; /* TRUE when fchdir() doesn't work */
113 char_u olddir[MAXPATHL];
117 /* expand it if forced or not an absolute path */
118 if (force || !mch_isFullName(fname))
122 int force; /* also expand when already absolute path */
126 int only_drive; /* file name is only a drive letter */
130 static int dont_fchdir = FALSE; /* TRUE when fchdir() doesn't work */
132 char_u olddir[MAXPATHL];
137 + fname = vms_fixfilename(fname);
140 /* expand it if forced or not an absolute path */
141 if (force || !mch_isFullName(fname))
145 * and then do the getwd() (and get back to where we were).
146 * This will get the correct path name with "../" things.
150 if (((p = vim_strrchr(fname, '/')) != NULL)
151 || ((p = vim_strrchr(fname, '\\')) != NULL)
152 || (((p = vim_strchr(fname, ':')) != NULL) && ++only_drive))
154 if ((p = vim_strrchr(fname, '/')) != NULL)
157 ! # ifdef HAVE_FCHDIR
159 * Use fchdir() if possible, it's said to be faster and more
160 * reliable. But on SunOS 4 it might not work. Check this by
162 * and then do the getwd() (and get back to where we were).
163 * This will get the correct path name with "../" things.
167 if (((p = vim_strrchr(fname, '/')) != NULL)
168 || ((p = vim_strrchr(fname, '\\')) != NULL)
169 || (((p = vim_strchr(fname, ':')) != NULL) && ++only_drive))
171 if ((p = vim_strrchr(fname, '/')) != NULL)
176 * Use fchdir() if possible, it's said to be faster and more
177 * reliable. But on SunOS 4 it might not work. Check this by
180 dont_fchdir = TRUE; /* don't try again */
185 /* Only change directory when we are sure we can return to where
186 * we are now. After doing "su" chdir(".") might not work. */
188 ! # ifdef HAVE_FCHDIR
191 (mch_dirname(olddir, MAXPATHL) == FAIL
192 || mch_chdir((char *)olddir) != 0))
195 dont_fchdir = TRUE; /* don't try again */
200 /* Only change directory when we are sure we can return to where
201 * we are now. After doing "su" chdir(".") might not work. */
206 (mch_dirname(olddir, MAXPATHL) == FAIL
207 || mch_chdir((char *)olddir) != 0))
216 * compensate for case where ':' from "D:" was the only
217 * path separator detected in the file name; the _next_
224 * compensate for case where ':' from "D:" was the only
225 * path separator detected in the file name; the _next_
232 /* The directory is copied into buf[], to be able to remove
233 * the file name without changing it (could be a string in
234 * read-only memory) */
240 /* The directory is copied into buf[], to be able to remove
241 * the file name without changing it (could be a string in
242 * read-only memory) */
258 if (mch_dirname(buf, len) == FAIL)
273 if (mch_dirname(buf, len) == FAIL)
279 ! # ifdef HAVE_FCHDIR
287 l = mch_chdir((char *)olddir);
302 l = mch_chdir((char *)olddir);
314 if (l > 0 && buf[l - 1] != '/' && *fname != NUL
315 && STRCMP(fname, ".") != 0)
321 /* Catch file names which are too long. */
324 /* Do not append ".", "/dir/." is equal to "/dir". */
325 if (STRCMP(fname, ".") != 0)
333 *** ../vim-7.0.207/src/version.c Sun Mar 4 21:25:44 2007
334 --- src/version.c Tue Mar 6 20:22:52 2007
338 { /* Add new patch number below this line */
344 hundred-and-one symptoms of being an internet addict:
345 262. Your computer has it's own phone line - but your daughter doesn't.
347 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\
348 /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
349 \\\ download, build and distribute -- http://www.A-A-P.org ///
350 \\\ help me help AIDS victims -- http://ICCF-Holland.org ///