Karsten Hopp 2f404e
To: vim-dev@vim.org
Karsten Hopp 2f404e
Subject: patch 7.1.135
Karsten Hopp 2f404e
Fcc: outbox
Karsten Hopp 2f404e
From: Bram Moolenaar <Bram@moolenaar.net>
Karsten Hopp 2f404e
Mime-Version: 1.0
Karsten Hopp 2f404e
Content-Type: text/plain; charset=ISO-8859-1
Karsten Hopp 2f404e
Content-Transfer-Encoding: 8bit
Karsten Hopp 2f404e
------------
Karsten Hopp 2f404e
Karsten Hopp 2f404e
Patch 7.1.135
Karsten Hopp 2f404e
Problem:    Win32: When editing a file c:\tmp\foo and c:\tmp\\foo we have two
Karsten Hopp 2f404e
	    buffers for the same file. (Suresh Govindachar)
Karsten Hopp 2f404e
Solution:   Invoke FullName_save() when a path contains "//" or "\\".
Karsten Hopp 2f404e
Files:	    src/buffer.c
Karsten Hopp 2f404e
Karsten Hopp 2f404e
Karsten Hopp 2f404e
*** ../vim-7.1.134/src/buffer.c	Sun Sep 30 14:00:41 2007
Karsten Hopp 2f404e
--- src/buffer.c	Wed Oct  3 14:24:52 2007
Karsten Hopp 2f404e
***************
Karsten Hopp 2f404e
*** 4175,4203 ****
Karsten Hopp 2f404e
       * mess up the full path name, even though it starts with a '/'.
Karsten Hopp 2f404e
       * Also expand when there is ".." in the file name, try to remove it,
Karsten Hopp 2f404e
       * because "c:/src/../README" is equal to "c:/README".
Karsten Hopp 2f404e
       * For MS-Windows also expand names like "longna~1" to "longname".
Karsten Hopp 2f404e
       */
Karsten Hopp 2f404e
  #ifdef UNIX
Karsten Hopp 2f404e
      return FullName_save(fname, TRUE);
Karsten Hopp 2f404e
  #else
Karsten Hopp 2f404e
!     if (!vim_isAbsName(fname) || strstr((char *)fname, "..") != NULL
Karsten Hopp 2f404e
! #if defined(MSWIN) || defined(DJGPP)
Karsten Hopp 2f404e
  	    || vim_strchr(fname, '~') != NULL
Karsten Hopp 2f404e
! #endif
Karsten Hopp 2f404e
  	    )
Karsten Hopp 2f404e
  	return FullName_save(fname, FALSE);
Karsten Hopp 2f404e
  
Karsten Hopp 2f404e
      fname = vim_strsave(fname);
Karsten Hopp 2f404e
  
Karsten Hopp 2f404e
! #ifdef USE_FNAME_CASE
Karsten Hopp 2f404e
! # ifdef USE_LONG_FNAME
Karsten Hopp 2f404e
      if (USE_LONG_FNAME)
Karsten Hopp 2f404e
! # endif
Karsten Hopp 2f404e
      {
Karsten Hopp 2f404e
  	if (fname != NULL)
Karsten Hopp 2f404e
  	    fname_case(fname, 0);	/* set correct case for file name */
Karsten Hopp 2f404e
      }
Karsten Hopp 2f404e
! #endif
Karsten Hopp 2f404e
  
Karsten Hopp 2f404e
      return fname;
Karsten Hopp 2f404e
  #endif
Karsten Hopp 2f404e
--- 4175,4209 ----
Karsten Hopp 2f404e
       * mess up the full path name, even though it starts with a '/'.
Karsten Hopp 2f404e
       * Also expand when there is ".." in the file name, try to remove it,
Karsten Hopp 2f404e
       * because "c:/src/../README" is equal to "c:/README".
Karsten Hopp 2f404e
+      * Similarly "c:/src//file" is equal to "c:/src/file".
Karsten Hopp 2f404e
       * For MS-Windows also expand names like "longna~1" to "longname".
Karsten Hopp 2f404e
       */
Karsten Hopp 2f404e
  #ifdef UNIX
Karsten Hopp 2f404e
      return FullName_save(fname, TRUE);
Karsten Hopp 2f404e
  #else
Karsten Hopp 2f404e
!     if (!vim_isAbsName(fname)
Karsten Hopp 2f404e
! 	    || strstr((char *)fname, "..") != NULL
Karsten Hopp 2f404e
! 	    || strstr((char *)fname, "//") != NULL
Karsten Hopp 2f404e
! # ifdef BACKSLASH_IN_FILENAME
Karsten Hopp 2f404e
! 	    || strstr((char *)fname, "\\\\") != NULL
Karsten Hopp 2f404e
! # endif
Karsten Hopp 2f404e
! # if defined(MSWIN) || defined(DJGPP)
Karsten Hopp 2f404e
  	    || vim_strchr(fname, '~') != NULL
Karsten Hopp 2f404e
! # endif
Karsten Hopp 2f404e
  	    )
Karsten Hopp 2f404e
  	return FullName_save(fname, FALSE);
Karsten Hopp 2f404e
  
Karsten Hopp 2f404e
      fname = vim_strsave(fname);
Karsten Hopp 2f404e
  
Karsten Hopp 2f404e
! # ifdef USE_FNAME_CASE
Karsten Hopp 2f404e
! #  ifdef USE_LONG_FNAME
Karsten Hopp 2f404e
      if (USE_LONG_FNAME)
Karsten Hopp 2f404e
! #  endif
Karsten Hopp 2f404e
      {
Karsten Hopp 2f404e
  	if (fname != NULL)
Karsten Hopp 2f404e
  	    fname_case(fname, 0);	/* set correct case for file name */
Karsten Hopp 2f404e
      }
Karsten Hopp 2f404e
! # endif
Karsten Hopp 2f404e
  
Karsten Hopp 2f404e
      return fname;
Karsten Hopp 2f404e
  #endif
Karsten Hopp 2f404e
*** ../vim-7.1.134/src/version.c	Wed Oct  3 13:28:40 2007
Karsten Hopp 2f404e
--- src/version.c	Wed Oct  3 14:26:54 2007
Karsten Hopp 2f404e
***************
Karsten Hopp 2f404e
*** 668,669 ****
Karsten Hopp 2f404e
--- 668,671 ----
Karsten Hopp 2f404e
  {   /* Add new patch number below this line */
Karsten Hopp 2f404e
+ /**/
Karsten Hopp 2f404e
+     135,
Karsten Hopp 2f404e
  /**/
Karsten Hopp 2f404e
Karsten Hopp 2f404e
-- 
Karsten Hopp 2f404e
   A village.  Sound of chanting of Latin canon, punctuated by short, sharp
Karsten Hopp 2f404e
   cracks.  It comes nearer.  We see it is a line of MONKS ala SEVENTH SEAL
Karsten Hopp 2f404e
   flagellation scene, chanting and banging themselves on the foreheads with
Karsten Hopp 2f404e
   wooden boards.
Karsten Hopp 2f404e
                 "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD
Karsten Hopp 2f404e
Karsten Hopp 2f404e
 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
Karsten Hopp 2f404e
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
Karsten Hopp 2f404e
\\\        download, build and distribute -- http://www.A-A-P.org        ///
Karsten Hopp 2f404e
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///