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