On 18-Apr-2013 14:14 +0200, Nazri Ramliy wrote:

> On Tue, Apr 16, 2013 at 4:31 PM, Nazri Ramliy <[email protected]> wrote:
>> I can reproduce this with my gvim 7.3.46 (on linux vim 7.3.892 there's> no 
>> problem). I'll investigate and hopefully post a fix soon.
> 
> I found the problem and the solution.
> 
> Problem summary:
> 
> expand_path_option() leaves trailing path separators after expanding the
> path option. These expanded paths are passed to globpath(), which then
> fed them to copy_option_part() as a comma-separated list of paths. On
> windows the presence of the trailing path separator before the comma
> causes copy_option_part() to not work as intended as it treats the
> backslash as escaping the commas.

> Solution:
> 
> Fix expand_path_option to not leave a trailing path separators when
> expanding the 'path' option.

Please note that for the root directory, C:\ is different than C: (which
means the current working directory of the C drive), so leaving off the
trailing path separator may cause problems in this case. (I haven't
checked your patch, but :echo globpath('C:', '*') returns different
results than :echo globpath('C:\', '*') after :cd C:\windows.

-- regards, ingo

> Example problem:
> 
> With 'path' set to ".,,", and editing the file c:\foo\bar.txt, from the
> directory c:\, and doing :find quu<tab>, expand_path_option() expands
> the ".,," to:
> 
>   c:\foo\,c:\
> 
> Which is wrongly treated as a single option value by copy_option_part()
> 
> Compare the same behavior on unix:
> 
> when editing /foo/bar.txt and the current directory is /,
> expand_path_option() expands the ".,," to:
> 
>   /foo/,/
> 
> This is seen as two option values by copy_option_part()
> 
> Attached patch fixes this problem. It adds a test case that shows the
> problem - note that the problem only happen on windows, so the test
> fails on windows but ran successfully on unix.
> 
> Nazri.


-- 
-- 
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/groups/opt_out.


Raspunde prin e-mail lui