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