1fa1ff
To: vim_dev@googlegroups.com
1fa1ff
Subject: Patch 7.4.006
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.006
1fa1ff
Problem:    mkdir("foo/bar/", "p") gives an error message. (David Barnett)
1fa1ff
Solution:   Remove the trailing slash. (lcd)
1fa1ff
Files:	    src/eval.c
1fa1ff
1fa1ff
1fa1ff
*** ../vim-7.4.005/src/eval.c	2013-07-05 18:23:42.000000000 +0200
1fa1ff
--- src/eval.c	2013-08-22 12:00:28.000000000 +0200
1fa1ff
***************
1fa1ff
*** 14292,14297 ****
1fa1ff
--- 14292,14301 ----
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
***************
1fa1ff
*** 14299,14305 ****
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 ? vim_mkdir_emsg(dir, prot) : 0;
1fa1ff
  }
1fa1ff
  #endif
1fa1ff
  
1fa1ff
--- 14303,14309 ----
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
*** ../vim-7.4.005/src/version.c	2013-08-14 17:45:25.000000000 +0200
1fa1ff
--- src/version.c	2013-08-22 12:02:46.000000000 +0200
1fa1ff
***************
1fa1ff
*** 729,730 ****
1fa1ff
--- 729,732 ----
1fa1ff
  {   /* Add new patch number below this line */
1fa1ff
+ /**/
1fa1ff
+     6,
1fa1ff
  /**/
1fa1ff
1fa1ff
-- 
1fa1ff
hundred-and-one symptoms of being an internet addict:
1fa1ff
97. Your mother tells you to remember something, and you look for
1fa1ff
    a File/Save command.
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    ///