On Wed, Aug 21, 2013 at 06:41:37PM +0300, LCD 47 wrote:
> On 21 August 2013, Marius Gedminas <[email protected]> wrote:
> > On Wed, Aug 21, 2013 at 01:56:31PM +0300, LCD 47 wrote:
> > > On 20 August 2013, David Barnett <[email protected]> wrote:
> > > > Ensure ./foo doesn't exist, and do
> > > >   :call mkdir('foo/bar/', 'p')
> > > > 
> > > > Vim gives you an error:
> > > >   E739: Cannot create directory: foo/bar/
> > > > but the directory was created just fine.
> > > > 
> > > > Dropping the trailing slash works without error:
> > > >   :call mkdir('foo/bar', 'p')
> > > 
> > >     Please try the patch below.  It kills the trailing slash, which
> > > seems pretty awkward for a fix.
> > 
> > 
> > > diff -r ae6c19fb32e1 src/eval.c
> > > --- a/src/eval.c  Wed Aug 14 17:45:29 2013 +0200
> > > +++ b/src/eval.c  Wed Aug 21 13:49:19 2013 +0300
> > > @@ -14284,6 +14284,7 @@
> > >      typval_T     *rettv;
> > >  {
> > >      char_u       *dir;
> > > +    char_u       *p;
> > >      char_u       buf[NUMBUFLEN];
> > >      int          prot = 0755;
> > >  
> > > @@ -14292,6 +14293,13 @@
> > >   return;
> > >  
> > >      dir = get_tv_string_buf(&argvars[0], buf);
> > > +    p = gettail(dir);
> > > +    if (!*p)
> > > +    {
> > > + p = gettail_sep(dir);
> > > + *p = 0;
> > > +    }
> > > +
> > 
> > What about :call mkdir('foo/bar//', 'p')?
> [...]
> 
>     It should work just as well.  Have you actually tried the patch?

No, I just wondered if you thought about that case.

Marius Gedminas
-- 
Never assume the reader has read the subject line.

Attachment: signature.asc
Description: Digital signature

Raspunde prin e-mail lui