Karsten Hopp 436396
To: vim_dev@googlegroups.com
Karsten Hopp 436396
Subject: Patch 7.4.006
Karsten Hopp 436396
Fcc: outbox
Karsten Hopp 436396
From: Bram Moolenaar <Bram@moolenaar.net>
Karsten Hopp 436396
Mime-Version: 1.0
Karsten Hopp 436396
Content-Type: text/plain; charset=UTF-8
Karsten Hopp 436396
Content-Transfer-Encoding: 8bit
Karsten Hopp 436396
------------
Karsten Hopp 436396
Karsten Hopp 436396
Patch 7.4.006
Karsten Hopp 436396
Problem:    mkdir("foo/bar/", "p") gives an error message. (David Barnett)
Karsten Hopp 436396
Solution:   Remove the trailing slash. (lcd)
Karsten Hopp 436396
Files:	    src/eval.c
Karsten Hopp 436396
Karsten Hopp 436396
Karsten Hopp 436396
*** ../vim-7.4.005/src/eval.c	2013-07-05 18:23:42.000000000 +0200
Karsten Hopp 436396
--- src/eval.c	2013-08-22 12:00:28.000000000 +0200
Karsten Hopp 436396
***************
Karsten Hopp 436396
*** 14292,14297 ****
Karsten Hopp 436396
--- 14292,14301 ----
Karsten Hopp 436396
  	return;
Karsten Hopp 436396
  
Karsten Hopp 436396
      dir = get_tv_string_buf(&argvars[0], buf);
Karsten Hopp 436396
+     if (*gettail(dir) == NUL)
Karsten Hopp 436396
+ 	/* remove trailing slashes */
Karsten Hopp 436396
+ 	*gettail_sep(dir) = NUL;
Karsten Hopp 436396
+ 
Karsten Hopp 436396
      if (argvars[1].v_type != VAR_UNKNOWN)
Karsten Hopp 436396
      {
Karsten Hopp 436396
  	if (argvars[2].v_type != VAR_UNKNOWN)
Karsten Hopp 436396
***************
Karsten Hopp 436396
*** 14299,14305 ****
Karsten Hopp 436396
  	if (prot != -1 && STRCMP(get_tv_string(&argvars[1]), "p") == 0)
Karsten Hopp 436396
  	    mkdir_recurse(dir, prot);
Karsten Hopp 436396
      }
Karsten Hopp 436396
!     rettv->vval.v_number = prot != -1 ? vim_mkdir_emsg(dir, prot) : 0;
Karsten Hopp 436396
  }
Karsten Hopp 436396
  #endif
Karsten Hopp 436396
  
Karsten Hopp 436396
--- 14303,14309 ----
Karsten Hopp 436396
  	if (prot != -1 && STRCMP(get_tv_string(&argvars[1]), "p") == 0)
Karsten Hopp 436396
  	    mkdir_recurse(dir, prot);
Karsten Hopp 436396
      }
Karsten Hopp 436396
!     rettv->vval.v_number = prot == -1 ? FAIL : vim_mkdir_emsg(dir, prot);
Karsten Hopp 436396
  }
Karsten Hopp 436396
  #endif
Karsten Hopp 436396
  
Karsten Hopp 436396
*** ../vim-7.4.005/src/version.c	2013-08-14 17:45:25.000000000 +0200
Karsten Hopp 436396
--- src/version.c	2013-08-22 12:02:46.000000000 +0200
Karsten Hopp 436396
***************
Karsten Hopp 436396
*** 729,730 ****
Karsten Hopp 436396
--- 729,732 ----
Karsten Hopp 436396
  {   /* Add new patch number below this line */
Karsten Hopp 436396
+ /**/
Karsten Hopp 436396
+     6,
Karsten Hopp 436396
  /**/
Karsten Hopp 436396
Karsten Hopp 436396
-- 
Karsten Hopp 436396
hundred-and-one symptoms of being an internet addict:
Karsten Hopp 436396
97. Your mother tells you to remember something, and you look for
Karsten Hopp 436396
    a File/Save command.
Karsten Hopp 436396
Karsten Hopp 436396
 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
Karsten Hopp 436396
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
Karsten Hopp 436396
\\\  an exciting new programming language -- http://www.Zimbu.org        ///
Karsten Hopp 436396
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///