Karsten Hopp 10632f
To: vim_dev@googlegroups.com
Karsten Hopp 10632f
Subject: Patch 7.3.690
Karsten Hopp 10632f
Fcc: outbox
Karsten Hopp 10632f
From: Bram Moolenaar <Bram@moolenaar.net>
Karsten Hopp 10632f
Mime-Version: 1.0
Karsten Hopp 10632f
Content-Type: text/plain; charset=UTF-8
Karsten Hopp 10632f
Content-Transfer-Encoding: 8bit
Karsten Hopp 10632f
------------
Karsten Hopp 10632f
Karsten Hopp 10632f
Patch 7.3.690
Karsten Hopp 10632f
Problem:    When the current directory name is exactly the maximum path length
Karsten Hopp 10632f
            Vim may crash.
Karsten Hopp 10632f
Solution:   Only add "/" when there is room. (Danek Duvall)
Karsten Hopp 10632f
Files:      src/os_unix.c
Karsten Hopp 10632f
Karsten Hopp 10632f
Karsten Hopp 10632f
*** ../vim-7.3.689/src/os_unix.c	2012-08-15 17:26:53.000000000 +0200
Karsten Hopp 10632f
--- src/os_unix.c	2012-10-14 04:28:40.000000000 +0200
Karsten Hopp 10632f
***************
Karsten Hopp 10632f
*** 2512,2526 ****
Karsten Hopp 10632f
  	}
Karsten Hopp 10632f
  
Karsten Hopp 10632f
  	l = STRLEN(buf);
Karsten Hopp 10632f
! 	if (l >= len)
Karsten Hopp 10632f
! 	    retval = FAIL;
Karsten Hopp 10632f
  #ifndef VMS
Karsten Hopp 10632f
! 	else
Karsten Hopp 10632f
! 	{
Karsten Hopp 10632f
! 	    if (l > 0 && buf[l - 1] != '/' && *fname != NUL
Karsten Hopp 10632f
  						   && STRCMP(fname, ".") != 0)
Karsten Hopp 10632f
! 		STRCAT(buf, "/");
Karsten Hopp 10632f
! 	}
Karsten Hopp 10632f
  #endif
Karsten Hopp 10632f
      }
Karsten Hopp 10632f
  
Karsten Hopp 10632f
--- 2512,2523 ----
Karsten Hopp 10632f
  	}
Karsten Hopp 10632f
  
Karsten Hopp 10632f
  	l = STRLEN(buf);
Karsten Hopp 10632f
! 	if (l >= len - 1)
Karsten Hopp 10632f
! 	    retval = FAIL; /* no space for trailing "/" */
Karsten Hopp 10632f
  #ifndef VMS
Karsten Hopp 10632f
! 	else if (l > 0 && buf[l - 1] != '/' && *fname != NUL
Karsten Hopp 10632f
  						   && STRCMP(fname, ".") != 0)
Karsten Hopp 10632f
! 	    STRCAT(buf, "/");
Karsten Hopp 10632f
  #endif
Karsten Hopp 10632f
      }
Karsten Hopp 10632f
  
Karsten Hopp 10632f
*** ../vim-7.3.689/src/version.c	2012-10-14 03:41:54.000000000 +0200
Karsten Hopp 10632f
--- src/version.c	2012-10-14 04:26:17.000000000 +0200
Karsten Hopp 10632f
***************
Karsten Hopp 10632f
*** 721,722 ****
Karsten Hopp 10632f
--- 721,724 ----
Karsten Hopp 10632f
  {   /* Add new patch number below this line */
Karsten Hopp 10632f
+ /**/
Karsten Hopp 10632f
+     690,
Karsten Hopp 10632f
  /**/
Karsten Hopp 10632f
Karsten Hopp 10632f
-- 
Karsten Hopp 10632f
SOLDIER: What?  Ridden on a horse?
Karsten Hopp 10632f
ARTHUR:  Yes!
Karsten Hopp 10632f
SOLDIER: You're using coconuts!
Karsten Hopp 10632f
                 "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD
Karsten Hopp 10632f
Karsten Hopp 10632f
 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
Karsten Hopp 10632f
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
Karsten Hopp 10632f
\\\  an exciting new programming language -- http://www.Zimbu.org        ///
Karsten Hopp 10632f
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///