Karsten Hopp ac6eba
To: vim-dev@vim.org
Karsten Hopp ac6eba
Subject: Patch 7.0.171 (extra)
Karsten Hopp ac6eba
Fcc: outbox
Karsten Hopp ac6eba
From: Bram Moolenaar <Bram@moolenaar.net>
Karsten Hopp ac6eba
Mime-Version: 1.0
Karsten Hopp ac6eba
Content-Type: text/plain; charset=ISO-8859-1
Karsten Hopp ac6eba
Content-Transfer-Encoding: 8bit
Karsten Hopp ac6eba
------------
Karsten Hopp ac6eba
Karsten Hopp ac6eba
Patch 7.0.171 (extra)
Karsten Hopp ac6eba
Problem:    VMS: A file name with multiple paths is written in the wrong file.
Karsten Hopp ac6eba
Solution:   Get the actually used file name. (Zoltan Arpadffy)
Karsten Hopp ac6eba
	    Also add info to the :version command about compilation.
Karsten Hopp ac6eba
Files:	    src/Make_vms.mms, src/buffer.c, src/os_unix.c, src/version.c
Karsten Hopp ac6eba
Karsten Hopp ac6eba
Karsten Hopp ac6eba
*** ../vim-7.0.170/src/Make_vms.mms	Sun Apr 30 20:46:53 2006
Karsten Hopp ac6eba
--- src/Make_vms.mms	Mon Sep  4 20:54:51 2006
Karsten Hopp ac6eba
***************
Karsten Hopp ac6eba
*** 2,8 ****
Karsten Hopp ac6eba
  # Makefile for Vim on OpenVMS
Karsten Hopp ac6eba
  #
Karsten Hopp ac6eba
  # Maintainer:   Zoltan Arpadffy <arpadffy@polarhome.com>
Karsten Hopp ac6eba
! # Last change:  2006 Apr 30
Karsten Hopp ac6eba
  #
Karsten Hopp ac6eba
  # This has script been tested on VMS 6.2 to 8.2 on DEC Alpha, VAX and IA64
Karsten Hopp ac6eba
  # with MMS and MMK
Karsten Hopp ac6eba
--- 2,8 ----
Karsten Hopp ac6eba
  # Makefile for Vim on OpenVMS
Karsten Hopp ac6eba
  #
Karsten Hopp ac6eba
  # Maintainer:   Zoltan Arpadffy <arpadffy@polarhome.com>
Karsten Hopp ac6eba
! # Last change:  2006 Sep 04
Karsten Hopp ac6eba
  #
Karsten Hopp ac6eba
  # This has script been tested on VMS 6.2 to 8.2 on DEC Alpha, VAX and IA64
Karsten Hopp ac6eba
  # with MMS and MMK
Karsten Hopp ac6eba
***************
Karsten Hopp ac6eba
*** 13,19 ****
Karsten Hopp ac6eba
  #
Karsten Hopp ac6eba
  # Edit the lines in the Configuration section below for fine tuning.
Karsten Hopp ac6eba
  #
Karsten Hopp ac6eba
! # To build:    mms/descrip=Make_vms.mms
Karsten Hopp ac6eba
  # To clean up: mms/descrip=Make_vms.mms clean
Karsten Hopp ac6eba
  #
Karsten Hopp ac6eba
  # Hints and detailed description could be found in INSTALLVMS.TXT file.
Karsten Hopp ac6eba
--- 13,19 ----
Karsten Hopp ac6eba
  #
Karsten Hopp ac6eba
  # Edit the lines in the Configuration section below for fine tuning.
Karsten Hopp ac6eba
  #
Karsten Hopp ac6eba
! # To build:    mms/descrip=Make_vms.mms /ignore=warning
Karsten Hopp ac6eba
  # To clean up: mms/descrip=Make_vms.mms clean
Karsten Hopp ac6eba
  #
Karsten Hopp ac6eba
  # Hints and detailed description could be found in INSTALLVMS.TXT file.
Karsten Hopp ac6eba
***************
Karsten Hopp ac6eba
*** 21,30 ****
Karsten Hopp ac6eba
  ######################################################################
Karsten Hopp ac6eba
  # Configuration section.
Karsten Hopp ac6eba
  ######################################################################
Karsten Hopp ac6eba
- # Platform selection
Karsten Hopp ac6eba
- # Define this if you will use the VAX platform to build.
Karsten Hopp ac6eba
- # VAX = YES
Karsten Hopp ac6eba
- 
Karsten Hopp ac6eba
  # VMS version
Karsten Hopp ac6eba
  # Uncomment if you use VMS version 6.2 or older
Karsten Hopp ac6eba
  # OLD_VMS = YES
Karsten Hopp ac6eba
--- 21,26 ----
Karsten Hopp ac6eba
***************
Karsten Hopp ac6eba
*** 49,54 ****
Karsten Hopp ac6eba
--- 45,51 ----
Karsten Hopp ac6eba
  
Karsten Hopp ac6eba
  # GUI with GTK
Karsten Hopp ac6eba
  # If you have GTK installed you might want to enable this option.
Karsten Hopp ac6eba
+ # NOTE: you will need to properly define GTK_DIR below
Karsten Hopp ac6eba
  # GTK = YES
Karsten Hopp ac6eba
  
Karsten Hopp ac6eba
  # GUI/Motif with XPM
Karsten Hopp ac6eba
***************
Karsten Hopp ac6eba
*** 97,103 ****
Karsten Hopp ac6eba
  
Karsten Hopp ac6eba
  # Compiler setup
Karsten Hopp ac6eba
  
Karsten Hopp ac6eba
! .IFDEF VAX
Karsten Hopp ac6eba
  .IFDEF DECC	     # VAX with DECC
Karsten Hopp ac6eba
  CC_DEF  = cc # /decc # some system requires this switch
Karsten Hopp ac6eba
  		     # but when it is not required /ver might fail
Karsten Hopp ac6eba
--- 94,100 ----
Karsten Hopp ac6eba
  
Karsten Hopp ac6eba
  # Compiler setup
Karsten Hopp ac6eba
  
Karsten Hopp ac6eba
! .IFDEF MMSVAX
Karsten Hopp ac6eba
  .IFDEF DECC	     # VAX with DECC
Karsten Hopp ac6eba
  CC_DEF  = cc # /decc # some system requires this switch
Karsten Hopp ac6eba
  		     # but when it is not required /ver might fail
Karsten Hopp ac6eba
***************
Karsten Hopp ac6eba
*** 165,172 ****
Karsten Hopp ac6eba
  # NOTE: you need to set up your GTK_DIR (GTK root directory), because it is
Karsten Hopp ac6eba
  # unique on every system - logicals are not accepted
Karsten Hopp ac6eba
  # please note: directory should end with . in order to /trans=conc work
Karsten Hopp ac6eba
! # Example: GTK_DIR  = $1$DGA104:[USERS.ZAY.WORK.GTK1210.]
Karsten Hopp ac6eba
! GTK_DIR  = DKA0:[GTK1210.]
Karsten Hopp ac6eba
  DEFS     = "HAVE_CONFIG_H","FEAT_GUI_GTK"
Karsten Hopp ac6eba
  LIBS     = ,OS_VMS_GTK.OPT/OPT
Karsten Hopp ac6eba
  GUI_FLAG = /name=(as_is,short)/float=ieee/ieee=denorm
Karsten Hopp ac6eba
--- 162,169 ----
Karsten Hopp ac6eba
  # NOTE: you need to set up your GTK_DIR (GTK root directory), because it is
Karsten Hopp ac6eba
  # unique on every system - logicals are not accepted
Karsten Hopp ac6eba
  # please note: directory should end with . in order to /trans=conc work
Karsten Hopp ac6eba
! # This value for GTK_DIR is an example.
Karsten Hopp ac6eba
! GTK_DIR  = $1$DGA104:[USERS.ZAY.WORK.GTK1210.]
Karsten Hopp ac6eba
  DEFS     = "HAVE_CONFIG_H","FEAT_GUI_GTK"
Karsten Hopp ac6eba
  LIBS     = ,OS_VMS_GTK.OPT/OPT
Karsten Hopp ac6eba
  GUI_FLAG = /name=(as_is,short)/float=ieee/ieee=denorm
Karsten Hopp ac6eba
***************
Karsten Hopp ac6eba
*** 274,280 ****
Karsten Hopp ac6eba
  # Please, do not change anything below without programming experience.
Karsten Hopp ac6eba
  ######################################################################
Karsten Hopp ac6eba
  
Karsten Hopp ac6eba
- 
Karsten Hopp ac6eba
  MODEL_DEF = "FEAT_$(MODEL)",
Karsten Hopp ac6eba
  
Karsten Hopp ac6eba
  # These go into pathdef.c
Karsten Hopp ac6eba
--- 271,276 ----
Karsten Hopp ac6eba
***************
Karsten Hopp ac6eba
*** 360,366 ****
Karsten Hopp ac6eba
  	-@ write pd "char_u *all_lflags = (char_u *)""$(LD_DEF)$(LDFLAGS) /exe=$(TARGET) *.OBJ $(ALL_LIBS)"";"
Karsten Hopp ac6eba
  	-@ write pd "char_u *compiler_version = (char_u *) ""''CC_VER'"";"
Karsten Hopp ac6eba
  	-@ write pd "char_u *compiled_user = (char_u *) "$(VIMUSER)";"
Karsten Hopp ac6eba
! 	-@ write pd "char_u *compiled_sys = (char_u *) "$(VIMHOST)";"
Karsten Hopp ac6eba
  	-@ close pd
Karsten Hopp ac6eba
  
Karsten Hopp ac6eba
  if_perl.c : if_perl.xs
Karsten Hopp ac6eba
--- 356,363 ----
Karsten Hopp ac6eba
  	-@ write pd "char_u *all_lflags = (char_u *)""$(LD_DEF)$(LDFLAGS) /exe=$(TARGET) *.OBJ $(ALL_LIBS)"";"
Karsten Hopp ac6eba
  	-@ write pd "char_u *compiler_version = (char_u *) ""''CC_VER'"";"
Karsten Hopp ac6eba
  	-@ write pd "char_u *compiled_user = (char_u *) "$(VIMUSER)";"
Karsten Hopp ac6eba
! 	-@ write pd "char_u *compiled_sys  = (char_u *) "$(VIMHOST)";"
Karsten Hopp ac6eba
! 	-@ write pd "char_u *compiled_arch = (char_u *) ""$(MMSARCH_NAME)"";"
Karsten Hopp ac6eba
  	-@ close pd
Karsten Hopp ac6eba
  
Karsten Hopp ac6eba
  if_perl.c : if_perl.xs
Karsten Hopp ac6eba
*** ../vim-7.0.170/src/buffer.c	Tue Nov  7 22:41:37 2006
Karsten Hopp ac6eba
--- src/buffer.c	Tue Nov  7 21:08:02 2006
Karsten Hopp ac6eba
***************
Karsten Hopp ac6eba
*** 4145,4155 ****
Karsten Hopp ac6eba
      /*
Karsten Hopp ac6eba
       * Force expanding the path always for Unix, because symbolic links may
Karsten Hopp ac6eba
       * mess up the full path name, even though it starts with a '/'.
Karsten Hopp ac6eba
       * Also expand when there is ".." in the file name, try to remove it,
Karsten Hopp ac6eba
       * because "c:/src/../README" is equal to "c:/README".
Karsten Hopp ac6eba
       * For MS-Windows also expand names like "longna~1" to "longname".
Karsten Hopp ac6eba
       */
Karsten Hopp ac6eba
! #ifdef UNIX
Karsten Hopp ac6eba
      return FullName_save(fname, TRUE);
Karsten Hopp ac6eba
  #else
Karsten Hopp ac6eba
      if (!vim_isAbsName(fname) || strstr((char *)fname, "..") != NULL
Karsten Hopp ac6eba
--- 4145,4157 ----
Karsten Hopp ac6eba
      /*
Karsten Hopp ac6eba
       * Force expanding the path always for Unix, because symbolic links may
Karsten Hopp ac6eba
       * mess up the full path name, even though it starts with a '/'.
Karsten Hopp ac6eba
+      * Also expand always for VMS, it may have alternate paths that need to be
Karsten Hopp ac6eba
+      * resolved.
Karsten Hopp ac6eba
       * Also expand when there is ".." in the file name, try to remove it,
Karsten Hopp ac6eba
       * because "c:/src/../README" is equal to "c:/README".
Karsten Hopp ac6eba
       * For MS-Windows also expand names like "longna~1" to "longname".
Karsten Hopp ac6eba
       */
Karsten Hopp ac6eba
! #if defined(UNIX) || defined(VMS)
Karsten Hopp ac6eba
      return FullName_save(fname, TRUE);
Karsten Hopp ac6eba
  #else
Karsten Hopp ac6eba
      if (!vim_isAbsName(fname) || strstr((char *)fname, "..") != NULL
Karsten Hopp ac6eba
*** ../vim-7.0.170/src/os_unix.c	Tue Aug 29 17:28:56 2006
Karsten Hopp ac6eba
--- src/os_unix.c	Tue Nov 28 17:38:54 2006
Karsten Hopp ac6eba
***************
Karsten Hopp ac6eba
*** 2202,2208 ****
Karsten Hopp ac6eba
  #endif
Karsten Hopp ac6eba
  
Karsten Hopp ac6eba
  /*
Karsten Hopp ac6eba
!  * Get absolute file name into buffer 'buf' of length 'len' bytes.
Karsten Hopp ac6eba
   *
Karsten Hopp ac6eba
   * return FAIL for failure, OK for success
Karsten Hopp ac6eba
   */
Karsten Hopp ac6eba
--- 2202,2208 ----
Karsten Hopp ac6eba
  #endif
Karsten Hopp ac6eba
  
Karsten Hopp ac6eba
  /*
Karsten Hopp ac6eba
!  * Get absolute file name into "buf[len]".
Karsten Hopp ac6eba
   *
Karsten Hopp ac6eba
   * return FAIL for failure, OK for success
Karsten Hopp ac6eba
   */
Karsten Hopp ac6eba
***************
Karsten Hopp ac6eba
*** 2212,2233 ****
Karsten Hopp ac6eba
      int		len;
Karsten Hopp ac6eba
      int		force;		/* also expand when already absolute path */
Karsten Hopp ac6eba
  {
Karsten Hopp ac6eba
      int		l;
Karsten Hopp ac6eba
! #ifdef OS2
Karsten Hopp ac6eba
      int		only_drive;	/* file name is only a drive letter */
Karsten Hopp ac6eba
! #endif
Karsten Hopp ac6eba
! #ifdef HAVE_FCHDIR
Karsten Hopp ac6eba
      int		fd = -1;
Karsten Hopp ac6eba
      static int	dont_fchdir = FALSE;	/* TRUE when fchdir() doesn't work */
Karsten Hopp ac6eba
! #endif
Karsten Hopp ac6eba
      char_u	olddir[MAXPATHL];
Karsten Hopp ac6eba
      char_u	*p;
Karsten Hopp ac6eba
      int		retval = OK;
Karsten Hopp ac6eba
  
Karsten Hopp ac6eba
- #ifdef VMS
Karsten Hopp ac6eba
-     fname = vms_fixfilename(fname);
Karsten Hopp ac6eba
- #endif
Karsten Hopp ac6eba
- 
Karsten Hopp ac6eba
      /* expand it if forced or not an absolute path */
Karsten Hopp ac6eba
      if (force || !mch_isFullName(fname))
Karsten Hopp ac6eba
      {
Karsten Hopp ac6eba
--- 2212,2261 ----
Karsten Hopp ac6eba
      int		len;
Karsten Hopp ac6eba
      int		force;		/* also expand when already absolute path */
Karsten Hopp ac6eba
  {
Karsten Hopp ac6eba
+ #ifdef VMS
Karsten Hopp ac6eba
+     /*
Karsten Hopp ac6eba
+      * VMS does this in a completely different way.
Karsten Hopp ac6eba
+      *
Karsten Hopp ac6eba
+      * By default a file found in a complex path is written to the first
Karsten Hopp ac6eba
+      * directory in the path and not to the original directory.  This
Karsten Hopp ac6eba
+      * behaviour should be avoided for the existing files and we need to find
Karsten Hopp ac6eba
+      * the exact path of the edited file.
Karsten Hopp ac6eba
+      */
Karsten Hopp ac6eba
+     if (force || !mch_isFullName(fname))
Karsten Hopp ac6eba
+     {
Karsten Hopp ac6eba
+ 	char_u	*fixed_fname = vms_fixfilename(fname);
Karsten Hopp ac6eba
+ 	int	fd = mch_open((char *)fixed_fname, O_RDONLY | O_EXTRA, 0);
Karsten Hopp ac6eba
+ 
Karsten Hopp ac6eba
+ 	if (fd > 0)
Karsten Hopp ac6eba
+ 	{
Karsten Hopp ac6eba
+ 	    char nbuf[MAXNAMLEN];
Karsten Hopp ac6eba
+ 
Karsten Hopp ac6eba
+ 	    /* File exists, use getname() to get the real name. */
Karsten Hopp ac6eba
+ 	    if (getname(fd, nbuf))
Karsten Hopp ac6eba
+ 		vim_strncpy(fixed_fname, (char_u *)nbuf, (size_t)(len - 1));
Karsten Hopp ac6eba
+ 	    close(fd);
Karsten Hopp ac6eba
+ 	}
Karsten Hopp ac6eba
+ 
Karsten Hopp ac6eba
+ 	if (STRLEN(fixed_fname) >= len)
Karsten Hopp ac6eba
+ 	    return FAIL;
Karsten Hopp ac6eba
+ 
Karsten Hopp ac6eba
+ 	STRCPY(buf, fixed_fname);
Karsten Hopp ac6eba
+     }
Karsten Hopp ac6eba
+ 
Karsten Hopp ac6eba
+ #else /* not VMS */
Karsten Hopp ac6eba
+ 
Karsten Hopp ac6eba
      int		l;
Karsten Hopp ac6eba
! # ifdef OS2
Karsten Hopp ac6eba
      int		only_drive;	/* file name is only a drive letter */
Karsten Hopp ac6eba
! # endif
Karsten Hopp ac6eba
! # ifdef HAVE_FCHDIR
Karsten Hopp ac6eba
      int		fd = -1;
Karsten Hopp ac6eba
      static int	dont_fchdir = FALSE;	/* TRUE when fchdir() doesn't work */
Karsten Hopp ac6eba
! # endif
Karsten Hopp ac6eba
      char_u	olddir[MAXPATHL];
Karsten Hopp ac6eba
      char_u	*p;
Karsten Hopp ac6eba
      int		retval = OK;
Karsten Hopp ac6eba
  
Karsten Hopp ac6eba
      /* expand it if forced or not an absolute path */
Karsten Hopp ac6eba
      if (force || !mch_isFullName(fname))
Karsten Hopp ac6eba
      {
Karsten Hopp ac6eba
***************
Karsten Hopp ac6eba
*** 2236,2251 ****
Karsten Hopp ac6eba
  	 * and then do the getwd() (and get back to where we were).
Karsten Hopp ac6eba
  	 * This will get the correct path name with "../" things.
Karsten Hopp ac6eba
  	 */
Karsten Hopp ac6eba
! #ifdef OS2
Karsten Hopp ac6eba
  	only_drive = 0;
Karsten Hopp ac6eba
  	if (((p = vim_strrchr(fname, '/')) != NULL)
Karsten Hopp ac6eba
  		|| ((p = vim_strrchr(fname, '\\')) != NULL)
Karsten Hopp ac6eba
  		|| (((p = vim_strchr(fname,  ':')) != NULL) && ++only_drive))
Karsten Hopp ac6eba
! #else
Karsten Hopp ac6eba
  	if ((p = vim_strrchr(fname, '/')) != NULL)
Karsten Hopp ac6eba
! #endif
Karsten Hopp ac6eba
  	{
Karsten Hopp ac6eba
! #ifdef HAVE_FCHDIR
Karsten Hopp ac6eba
  	    /*
Karsten Hopp ac6eba
  	     * Use fchdir() if possible, it's said to be faster and more
Karsten Hopp ac6eba
  	     * reliable.  But on SunOS 4 it might not work.  Check this by
Karsten Hopp ac6eba
--- 2264,2279 ----
Karsten Hopp ac6eba
  	 * and then do the getwd() (and get back to where we were).
Karsten Hopp ac6eba
  	 * This will get the correct path name with "../" things.
Karsten Hopp ac6eba
  	 */
Karsten Hopp ac6eba
! # ifdef OS2
Karsten Hopp ac6eba
  	only_drive = 0;
Karsten Hopp ac6eba
  	if (((p = vim_strrchr(fname, '/')) != NULL)
Karsten Hopp ac6eba
  		|| ((p = vim_strrchr(fname, '\\')) != NULL)
Karsten Hopp ac6eba
  		|| (((p = vim_strchr(fname,  ':')) != NULL) && ++only_drive))
Karsten Hopp ac6eba
! # else
Karsten Hopp ac6eba
  	if ((p = vim_strrchr(fname, '/')) != NULL)
Karsten Hopp ac6eba
! # endif
Karsten Hopp ac6eba
  	{
Karsten Hopp ac6eba
! # ifdef HAVE_FCHDIR
Karsten Hopp ac6eba
  	    /*
Karsten Hopp ac6eba
  	     * Use fchdir() if possible, it's said to be faster and more
Karsten Hopp ac6eba
  	     * reliable.  But on SunOS 4 it might not work.  Check this by
Karsten Hopp ac6eba
***************
Karsten Hopp ac6eba
*** 2261,2274 ****
Karsten Hopp ac6eba
  		    dont_fchdir = TRUE;	    /* don't try again */
Karsten Hopp ac6eba
  		}
Karsten Hopp ac6eba
  	    }
Karsten Hopp ac6eba
! #endif
Karsten Hopp ac6eba
  
Karsten Hopp ac6eba
  	    /* Only change directory when we are sure we can return to where
Karsten Hopp ac6eba
  	     * we are now.  After doing "su" chdir(".") might not work. */
Karsten Hopp ac6eba
  	    if (
Karsten Hopp ac6eba
! #ifdef HAVE_FCHDIR
Karsten Hopp ac6eba
  		fd < 0 &&
Karsten Hopp ac6eba
! #endif
Karsten Hopp ac6eba
  			(mch_dirname(olddir, MAXPATHL) == FAIL
Karsten Hopp ac6eba
  					   || mch_chdir((char *)olddir) != 0))
Karsten Hopp ac6eba
  	    {
Karsten Hopp ac6eba
--- 2289,2302 ----
Karsten Hopp ac6eba
  		    dont_fchdir = TRUE;	    /* don't try again */
Karsten Hopp ac6eba
  		}
Karsten Hopp ac6eba
  	    }
Karsten Hopp ac6eba
! # endif
Karsten Hopp ac6eba
  
Karsten Hopp ac6eba
  	    /* Only change directory when we are sure we can return to where
Karsten Hopp ac6eba
  	     * we are now.  After doing "su" chdir(".") might not work. */
Karsten Hopp ac6eba
  	    if (
Karsten Hopp ac6eba
! # ifdef HAVE_FCHDIR
Karsten Hopp ac6eba
  		fd < 0 &&
Karsten Hopp ac6eba
! # endif
Karsten Hopp ac6eba
  			(mch_dirname(olddir, MAXPATHL) == FAIL
Karsten Hopp ac6eba
  					   || mch_chdir((char *)olddir) != 0))
Karsten Hopp ac6eba
  	    {
Karsten Hopp ac6eba
***************
Karsten Hopp ac6eba
*** 2277,2283 ****
Karsten Hopp ac6eba
  	    }
Karsten Hopp ac6eba
  	    else
Karsten Hopp ac6eba
  	    {
Karsten Hopp ac6eba
! #ifdef OS2
Karsten Hopp ac6eba
  		/*
Karsten Hopp ac6eba
  		 * compensate for case where ':' from "D:" was the only
Karsten Hopp ac6eba
  		 * path separator detected in the file name; the _next_
Karsten Hopp ac6eba
--- 2305,2311 ----
Karsten Hopp ac6eba
  	    }
Karsten Hopp ac6eba
  	    else
Karsten Hopp ac6eba
  	    {
Karsten Hopp ac6eba
! # ifdef OS2
Karsten Hopp ac6eba
  		/*
Karsten Hopp ac6eba
  		 * compensate for case where ':' from "D:" was the only
Karsten Hopp ac6eba
  		 * path separator detected in the file name; the _next_
Karsten Hopp ac6eba
***************
Karsten Hopp ac6eba
*** 2285,2291 ****
Karsten Hopp ac6eba
  		 */
Karsten Hopp ac6eba
  		if (only_drive)
Karsten Hopp ac6eba
  		    p++;
Karsten Hopp ac6eba
! #endif
Karsten Hopp ac6eba
  		/* The directory is copied into buf[], to be able to remove
Karsten Hopp ac6eba
  		 * the file name without changing it (could be a string in
Karsten Hopp ac6eba
  		 * read-only memory) */
Karsten Hopp ac6eba
--- 2313,2319 ----
Karsten Hopp ac6eba
  		 */
Karsten Hopp ac6eba
  		if (only_drive)
Karsten Hopp ac6eba
  		    p++;
Karsten Hopp ac6eba
! # endif
Karsten Hopp ac6eba
  		/* The directory is copied into buf[], to be able to remove
Karsten Hopp ac6eba
  		 * the file name without changing it (could be a string in
Karsten Hopp ac6eba
  		 * read-only memory) */
Karsten Hopp ac6eba
***************
Karsten Hopp ac6eba
*** 2300,2313 ****
Karsten Hopp ac6eba
  			fname = p + 1;
Karsten Hopp ac6eba
  		    *buf = NUL;
Karsten Hopp ac6eba
  		}
Karsten Hopp ac6eba
! #ifdef OS2
Karsten Hopp ac6eba
  		if (only_drive)
Karsten Hopp ac6eba
  		{
Karsten Hopp ac6eba
  		    p--;
Karsten Hopp ac6eba
  		    if (retval != FAIL)
Karsten Hopp ac6eba
  			fname--;
Karsten Hopp ac6eba
  		}
Karsten Hopp ac6eba
! #endif
Karsten Hopp ac6eba
  	    }
Karsten Hopp ac6eba
  	}
Karsten Hopp ac6eba
  	if (mch_dirname(buf, len) == FAIL)
Karsten Hopp ac6eba
--- 2328,2341 ----
Karsten Hopp ac6eba
  			fname = p + 1;
Karsten Hopp ac6eba
  		    *buf = NUL;
Karsten Hopp ac6eba
  		}
Karsten Hopp ac6eba
! # ifdef OS2
Karsten Hopp ac6eba
  		if (only_drive)
Karsten Hopp ac6eba
  		{
Karsten Hopp ac6eba
  		    p--;
Karsten Hopp ac6eba
  		    if (retval != FAIL)
Karsten Hopp ac6eba
  			fname--;
Karsten Hopp ac6eba
  		}
Karsten Hopp ac6eba
! # endif
Karsten Hopp ac6eba
  	    }
Karsten Hopp ac6eba
  	}
Karsten Hopp ac6eba
  	if (mch_dirname(buf, len) == FAIL)
Karsten Hopp ac6eba
***************
Karsten Hopp ac6eba
*** 2317,2330 ****
Karsten Hopp ac6eba
  	}
Karsten Hopp ac6eba
  	if (p != NULL)
Karsten Hopp ac6eba
  	{
Karsten Hopp ac6eba
! #ifdef HAVE_FCHDIR
Karsten Hopp ac6eba
  	    if (fd >= 0)
Karsten Hopp ac6eba
  	    {
Karsten Hopp ac6eba
  		l = fchdir(fd);
Karsten Hopp ac6eba
  		close(fd);
Karsten Hopp ac6eba
  	    }
Karsten Hopp ac6eba
  	    else
Karsten Hopp ac6eba
! #endif
Karsten Hopp ac6eba
  		l = mch_chdir((char *)olddir);
Karsten Hopp ac6eba
  	    if (l != 0)
Karsten Hopp ac6eba
  		EMSG(_(e_prev_dir));
Karsten Hopp ac6eba
--- 2345,2358 ----
Karsten Hopp ac6eba
  	}
Karsten Hopp ac6eba
  	if (p != NULL)
Karsten Hopp ac6eba
  	{
Karsten Hopp ac6eba
! # ifdef HAVE_FCHDIR
Karsten Hopp ac6eba
  	    if (fd >= 0)
Karsten Hopp ac6eba
  	    {
Karsten Hopp ac6eba
  		l = fchdir(fd);
Karsten Hopp ac6eba
  		close(fd);
Karsten Hopp ac6eba
  	    }
Karsten Hopp ac6eba
  	    else
Karsten Hopp ac6eba
! # endif
Karsten Hopp ac6eba
  		l = mch_chdir((char *)olddir);
Karsten Hopp ac6eba
  	    if (l != 0)
Karsten Hopp ac6eba
  		EMSG(_(e_prev_dir));
Karsten Hopp ac6eba
***************
Karsten Hopp ac6eba
*** 2333,2347 ****
Karsten Hopp ac6eba
  	l = STRLEN(buf);
Karsten Hopp ac6eba
  	if (l >= len)
Karsten Hopp ac6eba
  	    retval = FAIL;
Karsten Hopp ac6eba
- #ifndef VMS
Karsten Hopp ac6eba
  	else
Karsten Hopp ac6eba
  	{
Karsten Hopp ac6eba
  	    if (l > 0 && buf[l - 1] != '/' && *fname != NUL
Karsten Hopp ac6eba
  						   && STRCMP(fname, ".") != 0)
Karsten Hopp ac6eba
  		STRCAT(buf, "/");
Karsten Hopp ac6eba
  	}
Karsten Hopp ac6eba
- #endif
Karsten Hopp ac6eba
      }
Karsten Hopp ac6eba
      /* Catch file names which are too long. */
Karsten Hopp ac6eba
      if (retval == FAIL || STRLEN(buf) + STRLEN(fname) >= len)
Karsten Hopp ac6eba
  	return FAIL;
Karsten Hopp ac6eba
--- 2361,2374 ----
Karsten Hopp ac6eba
  	l = STRLEN(buf);
Karsten Hopp ac6eba
  	if (l >= len)
Karsten Hopp ac6eba
  	    retval = FAIL;
Karsten Hopp ac6eba
  	else
Karsten Hopp ac6eba
  	{
Karsten Hopp ac6eba
  	    if (l > 0 && buf[l - 1] != '/' && *fname != NUL
Karsten Hopp ac6eba
  						   && STRCMP(fname, ".") != 0)
Karsten Hopp ac6eba
  		STRCAT(buf, "/");
Karsten Hopp ac6eba
  	}
Karsten Hopp ac6eba
      }
Karsten Hopp ac6eba
+ 
Karsten Hopp ac6eba
      /* Catch file names which are too long. */
Karsten Hopp ac6eba
      if (retval == FAIL || STRLEN(buf) + STRLEN(fname) >= len)
Karsten Hopp ac6eba
  	return FAIL;
Karsten Hopp ac6eba
***************
Karsten Hopp ac6eba
*** 2349,2354 ****
Karsten Hopp ac6eba
--- 2376,2383 ----
Karsten Hopp ac6eba
      /* Do not append ".", "/dir/." is equal to "/dir". */
Karsten Hopp ac6eba
      if (STRCMP(fname, ".") != 0)
Karsten Hopp ac6eba
  	STRCAT(buf, fname);
Karsten Hopp ac6eba
+ 
Karsten Hopp ac6eba
+ #endif /* VMS */
Karsten Hopp ac6eba
  
Karsten Hopp ac6eba
      return OK;
Karsten Hopp ac6eba
  }
Karsten Hopp ac6eba
*** ../vim-7.0.170/src/version.c	Tue Nov 28 17:18:03 2006
Karsten Hopp ac6eba
--- src/version.c	Tue Nov 28 17:35:05 2006
Karsten Hopp ac6eba
***************
Karsten Hopp ac6eba
*** 1113,1118 ****
Karsten Hopp ac6eba
--- 1115,1128 ----
Karsten Hopp ac6eba
  #endif
Karsten Hopp ac6eba
  #ifdef VMS
Karsten Hopp ac6eba
      MSG_PUTS("\nOpenVMS version");
Karsten Hopp ac6eba
+ # ifdef HAVE_PATHDEF
Karsten Hopp ac6eba
+     if (*compiled_arch != NUL)
Karsten Hopp ac6eba
+     {
Karsten Hopp ac6eba
+ 	MSG_PUTS(" - ");
Karsten Hopp ac6eba
+ 	MSG_PUTS(compiled_arch);
Karsten Hopp ac6eba
+     }
Karsten Hopp ac6eba
+ # endif
Karsten Hopp ac6eba
+ 
Karsten Hopp ac6eba
  #endif
Karsten Hopp ac6eba
  
Karsten Hopp ac6eba
      /* Print the list of patch numbers if there is at least one. */
Karsten Hopp ac6eba
*** ../vim-7.0.170/src/version.c	Tue Nov 28 17:18:03 2006
Karsten Hopp ac6eba
--- src/version.c	Tue Nov 28 17:35:05 2006
Karsten Hopp ac6eba
***************
Karsten Hopp ac6eba
*** 668,669 ****
Karsten Hopp ac6eba
--- 668,671 ----
Karsten Hopp ac6eba
  {   /* Add new patch number below this line */
Karsten Hopp ac6eba
+ /**/
Karsten Hopp ac6eba
+     171,
Karsten Hopp ac6eba
  /**/
Karsten Hopp ac6eba
Karsten Hopp ac6eba
-- 
Karsten Hopp ac6eba
GUARD #1:  What, ridden on a horse?
Karsten Hopp ac6eba
ARTHUR:    Yes!
Karsten Hopp ac6eba
GUARD #1:  You're using coconuts!
Karsten Hopp ac6eba
ARTHUR:    What?
Karsten Hopp ac6eba
GUARD #1:  You've got two empty halves of coconut and you're bangin' 'em
Karsten Hopp ac6eba
           together.
Karsten Hopp ac6eba
                                  The Quest for the Holy Grail (Monty Python)
Karsten Hopp ac6eba
Karsten Hopp ac6eba
 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
Karsten Hopp ac6eba
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
Karsten Hopp ac6eba
\\\        download, build and distribute -- http://www.A-A-P.org        ///
Karsten Hopp ac6eba
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///