mirror of
https://github.com/vim/vim.git
synced 2025-07-26 11:04:33 -04:00
updated for version 7.0-208
This commit is contained in:
parent
81b85876ad
commit
38323e4f4a
@ -4145,13 +4145,11 @@ fix_fname(fname)
|
||||
/*
|
||||
* Force expanding the path always for Unix, because symbolic links may
|
||||
* mess up the full path name, even though it starts with a '/'.
|
||||
* Also expand always for VMS, it may have alternate paths that need to be
|
||||
* resolved.
|
||||
* Also expand when there is ".." in the file name, try to remove it,
|
||||
* because "c:/src/../README" is equal to "c:/README".
|
||||
* For MS-Windows also expand names like "longna~1" to "longname".
|
||||
*/
|
||||
#if defined(UNIX) || defined(VMS)
|
||||
#ifdef UNIX
|
||||
return FullName_save(fname, TRUE);
|
||||
#else
|
||||
if (!vim_isAbsName(fname) || strstr((char *)fname, "..") != NULL
|
||||
|
@ -3592,9 +3592,8 @@ makeswapname(fname, ffname, buf, dir_name)
|
||||
#else
|
||||
(buf->b_p_sn || buf->b_shortname),
|
||||
#endif
|
||||
#if defined(VMS) || defined(RISCOS)
|
||||
/* Avoid problems if fname has special chars, eg <Wimp$Scrap>.
|
||||
* For VMS always use full path for swapfile. */
|
||||
#ifdef RISCOS
|
||||
/* Avoid problems if fname has special chars, eg <Wimp$Scrap> */
|
||||
ffname,
|
||||
#else
|
||||
# ifdef HAVE_READLINK
|
||||
|
@ -2214,37 +2214,6 @@ mch_FullName(fname, buf, len, force)
|
||||
int len;
|
||||
int force; /* also expand when already absolute path */
|
||||
{
|
||||
#ifdef VMS
|
||||
/*
|
||||
* VMS does this in a completely different way.
|
||||
*
|
||||
* By default a file found in a complex path is written to the first
|
||||
* directory in the path and not to the original directory. This
|
||||
* behaviour should be avoided for the existing files and we need to find
|
||||
* the exact path of the edited file.
|
||||
*/
|
||||
{
|
||||
char_u *fixed_fname = vms_fixfilename(fname);
|
||||
int fd = mch_open((char *)fixed_fname, O_RDONLY | O_EXTRA, 0);
|
||||
|
||||
if (fd > 0)
|
||||
{
|
||||
char nbuf[MAXNAMLEN];
|
||||
|
||||
/* File exists, use getname() to get the real name. */
|
||||
if (getname(fd, nbuf))
|
||||
vim_strncpy(fixed_fname, (char_u *)nbuf, (size_t)(len - 1));
|
||||
close(fd);
|
||||
}
|
||||
|
||||
if (STRLEN(fixed_fname) >= len)
|
||||
return FAIL;
|
||||
|
||||
STRCPY(buf, fixed_fname);
|
||||
}
|
||||
|
||||
#else /* not VMS */
|
||||
|
||||
int l;
|
||||
#ifdef OS2
|
||||
int only_drive; /* file name is only a drive letter */
|
||||
@ -2257,6 +2226,10 @@ mch_FullName(fname, buf, len, force)
|
||||
char_u *p;
|
||||
int retval = OK;
|
||||
|
||||
#ifdef VMS
|
||||
fname = vms_fixfilename(fname);
|
||||
#endif
|
||||
|
||||
/* expand it if forced or not an absolute path */
|
||||
if (force || !mch_isFullName(fname))
|
||||
{
|
||||
@ -2362,12 +2335,14 @@ mch_FullName(fname, buf, len, force)
|
||||
l = STRLEN(buf);
|
||||
if (l >= len)
|
||||
retval = FAIL;
|
||||
#ifndef VMS
|
||||
else
|
||||
{
|
||||
if (l > 0 && buf[l - 1] != '/' && *fname != NUL
|
||||
&& STRCMP(fname, ".") != 0)
|
||||
STRCAT(buf, "/");
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
/* Catch file names which are too long. */
|
||||
@ -2378,8 +2353,6 @@ mch_FullName(fname, buf, len, force)
|
||||
if (STRCMP(fname, ".") != 0)
|
||||
STRCAT(buf, fname);
|
||||
|
||||
#endif /* VMS */
|
||||
|
||||
return OK;
|
||||
}
|
||||
|
||||
|
@ -666,6 +666,8 @@ static char *(features[]) =
|
||||
|
||||
static int included_patches[] =
|
||||
{ /* Add new patch number below this line */
|
||||
/**/
|
||||
208,
|
||||
/**/
|
||||
207,
|
||||
/**/
|
||||
|
Loading…
x
Reference in New Issue
Block a user