1
0
forked from aniani/vim

updated for version 7.0-171

This commit is contained in:
Bram Moolenaar
2006-11-28 16:43:58 +00:00
parent 85f868c3ae
commit 3d20ca1ad1
4 changed files with 74 additions and 36 deletions

View File

@@ -2,7 +2,7 @@
# Makefile for Vim on OpenVMS # Makefile for Vim on OpenVMS
# #
# Maintainer: Zoltan Arpadffy <arpadffy@polarhome.com> # Maintainer: Zoltan Arpadffy <arpadffy@polarhome.com>
# Last change: 2006 Apr 30 # Last change: 2006 Sep 04
# #
# This has script been tested on VMS 6.2 to 8.2 on DEC Alpha, VAX and IA64 # This has script been tested on VMS 6.2 to 8.2 on DEC Alpha, VAX and IA64
# with MMS and MMK # with MMS and MMK
@@ -13,7 +13,7 @@
# #
# Edit the lines in the Configuration section below for fine tuning. # Edit the lines in the Configuration section below for fine tuning.
# #
# To build: mms/descrip=Make_vms.mms # To build: mms/descrip=Make_vms.mms /ignore=warning
# To clean up: mms/descrip=Make_vms.mms clean # To clean up: mms/descrip=Make_vms.mms clean
# #
# Hints and detailed description could be found in INSTALLVMS.TXT file. # Hints and detailed description could be found in INSTALLVMS.TXT file.
@@ -21,10 +21,6 @@
###################################################################### ######################################################################
# Configuration section. # Configuration section.
###################################################################### ######################################################################
# Platform selection
# Define this if you will use the VAX platform to build.
# VAX = YES
# VMS version # VMS version
# Uncomment if you use VMS version 6.2 or older # Uncomment if you use VMS version 6.2 or older
# OLD_VMS = YES # OLD_VMS = YES
@@ -49,6 +45,7 @@ GUI = YES
# GUI with GTK # GUI with GTK
# If you have GTK installed you might want to enable this option. # If you have GTK installed you might want to enable this option.
# NOTE: you will need to properly define GTK_DIR below
# GTK = YES # GTK = YES
# GUI/Motif with XPM # GUI/Motif with XPM
@@ -97,7 +94,7 @@ CCVER = YES
# Compiler setup # Compiler setup
.IFDEF VAX .IFDEF MMSVAX
.IFDEF DECC # VAX with DECC .IFDEF DECC # VAX with DECC
CC_DEF = cc # /decc # some system requires this switch CC_DEF = cc # /decc # some system requires this switch
# but when it is not required /ver might fail # but when it is not required /ver might fail
@@ -165,8 +162,8 @@ GTK = ""
# NOTE: you need to set up your GTK_DIR (GTK root directory), because it is # NOTE: you need to set up your GTK_DIR (GTK root directory), because it is
# unique on every system - logicals are not accepted # unique on every system - logicals are not accepted
# please note: directory should end with . in order to /trans=conc work # please note: directory should end with . in order to /trans=conc work
# Example: GTK_DIR = $1$DGA104:[USERS.ZAY.WORK.GTK1210.] # This value for GTK_DIR is an example.
GTK_DIR = DKA0:[GTK1210.] GTK_DIR = $1$DGA104:[USERS.ZAY.WORK.GTK1210.]
DEFS = "HAVE_CONFIG_H","FEAT_GUI_GTK" DEFS = "HAVE_CONFIG_H","FEAT_GUI_GTK"
LIBS = ,OS_VMS_GTK.OPT/OPT LIBS = ,OS_VMS_GTK.OPT/OPT
GUI_FLAG = /name=(as_is,short)/float=ieee/ieee=denorm GUI_FLAG = /name=(as_is,short)/float=ieee/ieee=denorm
@@ -274,7 +271,6 @@ TAG_DEF = ,"FEAT_TAG_ANYWHITE"
# Please, do not change anything below without programming experience. # Please, do not change anything below without programming experience.
###################################################################### ######################################################################
MODEL_DEF = "FEAT_$(MODEL)", MODEL_DEF = "FEAT_$(MODEL)",
# These go into pathdef.c # These go into pathdef.c
@@ -361,6 +357,7 @@ pathdef.c : check_ccver $(CONFIG_H)
-@ write pd "char_u *compiler_version = (char_u *) ""''CC_VER'"";" -@ write pd "char_u *compiler_version = (char_u *) ""''CC_VER'"";"
-@ write pd "char_u *compiled_user = (char_u *) "$(VIMUSER)";" -@ write pd "char_u *compiled_user = (char_u *) "$(VIMUSER)";"
-@ write pd "char_u *compiled_sys = (char_u *) "$(VIMHOST)";" -@ write pd "char_u *compiled_sys = (char_u *) "$(VIMHOST)";"
-@ write pd "char_u *compiled_arch = (char_u *) ""$(MMSARCH_NAME)"";"
-@ close pd -@ close pd
if_perl.c : if_perl.xs if_perl.c : if_perl.xs

View File

@@ -4145,11 +4145,13 @@ fix_fname(fname)
/* /*
* Force expanding the path always for Unix, because symbolic links may * Force expanding the path always for Unix, because symbolic links may
* mess up the full path name, even though it starts with a '/'. * 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, * Also expand when there is ".." in the file name, try to remove it,
* because "c:/src/../README" is equal to "c:/README". * because "c:/src/../README" is equal to "c:/README".
* For MS-Windows also expand names like "longna~1" to "longname". * For MS-Windows also expand names like "longna~1" to "longname".
*/ */
#ifdef UNIX #if defined(UNIX) || defined(VMS)
return FullName_save(fname, TRUE); return FullName_save(fname, TRUE);
#else #else
if (!vim_isAbsName(fname) || strstr((char *)fname, "..") != NULL if (!vim_isAbsName(fname) || strstr((char *)fname, "..") != NULL

View File

@@ -2202,7 +2202,7 @@ slash_adjust(p)
#endif #endif
/* /*
* Get absolute file name into buffer 'buf' of length 'len' bytes. * Get absolute file name into "buf[len]".
* *
* return FAIL for failure, OK for success * return FAIL for failure, OK for success
*/ */
@@ -2212,22 +2212,50 @@ mch_FullName(fname, buf, len, force)
int len; int len;
int force; /* also expand when already absolute path */ 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.
*/
if (force || !mch_isFullName(fname))
{
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; int l;
#ifdef OS2 # ifdef OS2
int only_drive; /* file name is only a drive letter */ int only_drive; /* file name is only a drive letter */
#endif # endif
#ifdef HAVE_FCHDIR # ifdef HAVE_FCHDIR
int fd = -1; int fd = -1;
static int dont_fchdir = FALSE; /* TRUE when fchdir() doesn't work */ static int dont_fchdir = FALSE; /* TRUE when fchdir() doesn't work */
#endif # endif
char_u olddir[MAXPATHL]; char_u olddir[MAXPATHL];
char_u *p; char_u *p;
int retval = OK; int retval = OK;
#ifdef VMS
fname = vms_fixfilename(fname);
#endif
/* expand it if forced or not an absolute path */ /* expand it if forced or not an absolute path */
if (force || !mch_isFullName(fname)) if (force || !mch_isFullName(fname))
{ {
@@ -2236,16 +2264,16 @@ mch_FullName(fname, buf, len, force)
* and then do the getwd() (and get back to where we were). * and then do the getwd() (and get back to where we were).
* This will get the correct path name with "../" things. * This will get the correct path name with "../" things.
*/ */
#ifdef OS2 # ifdef OS2
only_drive = 0; only_drive = 0;
if (((p = vim_strrchr(fname, '/')) != NULL) if (((p = vim_strrchr(fname, '/')) != NULL)
|| ((p = vim_strrchr(fname, '\\')) != NULL) || ((p = vim_strrchr(fname, '\\')) != NULL)
|| (((p = vim_strchr(fname, ':')) != NULL) && ++only_drive)) || (((p = vim_strchr(fname, ':')) != NULL) && ++only_drive))
#else # else
if ((p = vim_strrchr(fname, '/')) != NULL) if ((p = vim_strrchr(fname, '/')) != NULL)
#endif # endif
{ {
#ifdef HAVE_FCHDIR # ifdef HAVE_FCHDIR
/* /*
* Use fchdir() if possible, it's said to be faster and more * Use fchdir() if possible, it's said to be faster and more
* reliable. But on SunOS 4 it might not work. Check this by * reliable. But on SunOS 4 it might not work. Check this by
@@ -2261,14 +2289,14 @@ mch_FullName(fname, buf, len, force)
dont_fchdir = TRUE; /* don't try again */ dont_fchdir = TRUE; /* don't try again */
} }
} }
#endif # endif
/* Only change directory when we are sure we can return to where /* Only change directory when we are sure we can return to where
* we are now. After doing "su" chdir(".") might not work. */ * we are now. After doing "su" chdir(".") might not work. */
if ( if (
#ifdef HAVE_FCHDIR # ifdef HAVE_FCHDIR
fd < 0 && fd < 0 &&
#endif # endif
(mch_dirname(olddir, MAXPATHL) == FAIL (mch_dirname(olddir, MAXPATHL) == FAIL
|| mch_chdir((char *)olddir) != 0)) || mch_chdir((char *)olddir) != 0))
{ {
@@ -2277,7 +2305,7 @@ mch_FullName(fname, buf, len, force)
} }
else else
{ {
#ifdef OS2 # ifdef OS2
/* /*
* compensate for case where ':' from "D:" was the only * compensate for case where ':' from "D:" was the only
* path separator detected in the file name; the _next_ * path separator detected in the file name; the _next_
@@ -2285,7 +2313,7 @@ mch_FullName(fname, buf, len, force)
*/ */
if (only_drive) if (only_drive)
p++; p++;
#endif # endif
/* The directory is copied into buf[], to be able to remove /* The directory is copied into buf[], to be able to remove
* the file name without changing it (could be a string in * the file name without changing it (could be a string in
* read-only memory) */ * read-only memory) */
@@ -2300,14 +2328,14 @@ mch_FullName(fname, buf, len, force)
fname = p + 1; fname = p + 1;
*buf = NUL; *buf = NUL;
} }
#ifdef OS2 # ifdef OS2
if (only_drive) if (only_drive)
{ {
p--; p--;
if (retval != FAIL) if (retval != FAIL)
fname--; fname--;
} }
#endif # endif
} }
} }
if (mch_dirname(buf, len) == FAIL) if (mch_dirname(buf, len) == FAIL)
@@ -2317,14 +2345,14 @@ mch_FullName(fname, buf, len, force)
} }
if (p != NULL) if (p != NULL)
{ {
#ifdef HAVE_FCHDIR # ifdef HAVE_FCHDIR
if (fd >= 0) if (fd >= 0)
{ {
l = fchdir(fd); l = fchdir(fd);
close(fd); close(fd);
} }
else else
#endif # endif
l = mch_chdir((char *)olddir); l = mch_chdir((char *)olddir);
if (l != 0) if (l != 0)
EMSG(_(e_prev_dir)); EMSG(_(e_prev_dir));
@@ -2333,15 +2361,14 @@ mch_FullName(fname, buf, len, force)
l = STRLEN(buf); l = STRLEN(buf);
if (l >= len) if (l >= len)
retval = FAIL; retval = FAIL;
#ifndef VMS
else else
{ {
if (l > 0 && buf[l - 1] != '/' && *fname != NUL if (l > 0 && buf[l - 1] != '/' && *fname != NUL
&& STRCMP(fname, ".") != 0) && STRCMP(fname, ".") != 0)
STRCAT(buf, "/"); STRCAT(buf, "/");
} }
#endif
} }
/* Catch file names which are too long. */ /* Catch file names which are too long. */
if (retval == FAIL || STRLEN(buf) + STRLEN(fname) >= len) if (retval == FAIL || STRLEN(buf) + STRLEN(fname) >= len)
return FAIL; return FAIL;
@@ -2350,6 +2377,8 @@ mch_FullName(fname, buf, len, force)
if (STRCMP(fname, ".") != 0) if (STRCMP(fname, ".") != 0)
STRCAT(buf, fname); STRCAT(buf, fname);
#endif /* VMS */
return OK; return OK;
} }

View File

@@ -666,6 +666,8 @@ static char *(features[]) =
static int included_patches[] = static int included_patches[] =
{ /* Add new patch number below this line */ { /* Add new patch number below this line */
/**/
171,
/**/ /**/
170, 170,
/**/ /**/
@@ -1113,6 +1115,14 @@ list_version()
#endif #endif
#ifdef VMS #ifdef VMS
MSG_PUTS("\nOpenVMS version"); MSG_PUTS("\nOpenVMS version");
# ifdef HAVE_PATHDEF
if (*compiled_arch != NUL)
{
MSG_PUTS(" - ");
MSG_PUTS(compiled_arch);
}
# endif
#endif #endif
/* Print the list of patch numbers if there is at least one. */ /* Print the list of patch numbers if there is at least one. */