Hi,

2014/11/20 Thu 2:04:58 UTC+9 Bram Moolenaar wrote:
> Ken Takata wrote:
> 
> > I found that wrong buffer size is used in modify_fname().
> > The allocated size is _MAX_PATH+1 (261), but MAXPATHL (1024) might be used.
> > The following patch fixes it:
> > 
> > diff --git a/src/eval.c b/src/eval.c
> > --- a/src/eval.c
> > +++ b/src/eval.c
> > @@ -24811,7 +24811,7 @@ repeat:
> >         p = alloc(_MAX_PATH + 1);
> >         if (p != NULL)
> >         {
> > -           if (GetLongPathName(*fnamep, p, MAXPATHL))
> > +           if (GetLongPathName(*fnamep, p, _MAX_PATH))
> >             {
> >                 vim_free(*bufp);
> >                 *bufp = *fnamep = p;
> 
> Thanks.  I'll include this.
> 
> I wonder about encoding, is the returned file name in the current
> codepage?  It should probably be converted to 'encoding' then.
> But perhaps we should use the wide version?

Yes, I think so too.  The current code might not work well, when a username
includes multibyte characters.  This code comes from 7.3.559.
I hope someone fixes this. ;-)

Regards,
Ken Takata

-- 
-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Raspunde prin e-mail lui