1fa1ff
To: vim_dev@googlegroups.com
1fa1ff
Subject: Patch 7.4.010
1fa1ff
Fcc: outbox
1fa1ff
From: Bram Moolenaar <Bram@moolenaar.net>
1fa1ff
Mime-Version: 1.0
1fa1ff
Content-Type: text/plain; charset=UTF-8
1fa1ff
Content-Transfer-Encoding: 8bit
1fa1ff
------------
1fa1ff
1fa1ff
Patch 7.4.010 (after 7.4.006)
1fa1ff
Problem:    Crash with invalid argument to mkdir().
1fa1ff
Solution:   Check for empty string. (lcd47)
1fa1ff
Files:	    src/eval.c
1fa1ff
1fa1ff
1fa1ff
*** ../vim-7.4.009/src/eval.c	2013-08-22 12:06:50.000000000 +0200
1fa1ff
--- src/eval.c	2013-08-30 15:47:47.000000000 +0200
1fa1ff
***************
1fa1ff
*** 14292,14309 ****
1fa1ff
  	return;
1fa1ff
  
1fa1ff
      dir = get_tv_string_buf(&argvars[0], buf);
1fa1ff
!     if (*gettail(dir) == NUL)
1fa1ff
! 	/* remove trailing slashes */
1fa1ff
! 	*gettail_sep(dir) = NUL;
1fa1ff
! 
1fa1ff
!     if (argvars[1].v_type != VAR_UNKNOWN)
1fa1ff
      {
1fa1ff
! 	if (argvars[2].v_type != VAR_UNKNOWN)
1fa1ff
! 	    prot = get_tv_number_chk(&argvars[2], NULL);
1fa1ff
! 	if (prot != -1 && STRCMP(get_tv_string(&argvars[1]), "p") == 0)
1fa1ff
! 	    mkdir_recurse(dir, prot);
1fa1ff
      }
1fa1ff
-     rettv->vval.v_number = prot == -1 ? FAIL : vim_mkdir_emsg(dir, prot);
1fa1ff
  }
1fa1ff
  #endif
1fa1ff
  
1fa1ff
--- 14292,14314 ----
1fa1ff
  	return;
1fa1ff
  
1fa1ff
      dir = get_tv_string_buf(&argvars[0], buf);
1fa1ff
!     if (*dir == NUL)
1fa1ff
! 	rettv->vval.v_number = FAIL;
1fa1ff
!     else
1fa1ff
      {
1fa1ff
! 	if (*gettail(dir) == NUL)
1fa1ff
! 	    /* remove trailing slashes */
1fa1ff
! 	    *gettail_sep(dir) = NUL;
1fa1ff
! 
1fa1ff
! 	if (argvars[1].v_type != VAR_UNKNOWN)
1fa1ff
! 	{
1fa1ff
! 	    if (argvars[2].v_type != VAR_UNKNOWN)
1fa1ff
! 		prot = get_tv_number_chk(&argvars[2], NULL);
1fa1ff
! 	    if (prot != -1 && STRCMP(get_tv_string(&argvars[1]), "p") == 0)
1fa1ff
! 		mkdir_recurse(dir, prot);
1fa1ff
! 	}
1fa1ff
! 	rettv->vval.v_number = prot == -1 ? FAIL : vim_mkdir_emsg(dir, prot);
1fa1ff
      }
1fa1ff
  }
1fa1ff
  #endif
1fa1ff
  
1fa1ff
*** ../vim-7.4.009/src/version.c	2013-08-25 17:46:05.000000000 +0200
1fa1ff
--- src/version.c	2013-08-30 15:48:37.000000000 +0200
1fa1ff
***************
1fa1ff
*** 729,730 ****
1fa1ff
--- 729,732 ----
1fa1ff
  {   /* Add new patch number below this line */
1fa1ff
+ /**/
1fa1ff
+     10,
1fa1ff
  /**/
1fa1ff
1fa1ff
-- 
1fa1ff
I wish there was a knob on the TV to turn up the intelligence.
1fa1ff
There's a knob called "brightness", but it doesn't seem to work. 
1fa1ff
1fa1ff
 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
1fa1ff
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
1fa1ff
\\\  an exciting new programming language -- http://www.Zimbu.org        ///
1fa1ff
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///