Nazri Ramliy wrote:

> >> This is a regression introduced by my own patch previously
> >> (7ce8b24450dc: Improvements for
> >> ":find" completion. (Nazri Ramliy)).
> >>
> >> Attached patch fixes the regression and add tests to test73 to
> >> catch the bug.
> >>
> >> The test runs fine on unix, but fails on msvc vim.  I'll investigate
> >> it later. Sorry I'm in a bit of a hurry
> >> I'll look into cleaning up the patch and making the test successfull
> >> on msvc vim soon.
> >
> > Thanks.
> >
> > I noticed a few memory leaks and fixed them.
> >
> > I changed the STRNCMP() to fnamencmp().  That might fix the problem on
> > MS-Windows.
> >
> > I moved a few C99 style declarations to start of code block.
> 
> Thanks the fixes. Sorry, the patch was made in a hurry.

No worries.  Thanks for taking the time to make these patches.
I do hope we get it right now, so close to the 7.3 release.


> > That's an awful lot of problems...  I'll spend some more time on this
> > tomorrow.
> 
> I've spent some time looking over the changes and made a few more fixes.
> 
> Instead of one big patch I'm attaching 7 small patches with the hope
> that they are easier for you to review. These are on top of the latest
> changeset at the moment (20e83abf88b1).
> 
> 0001: Make test73 pass on msvc-vim
> 
> 0002: Call uniquefy_paths only when there are candidates.

This was missing () around the or operator.  And I prefer to check a
number explicitly for being not zero:

        if (ga.ga_len > 0 && (flags & EW_PATH))


> 0003: I noticed that the "is_in_curdir" check only works correctly for
>       file, not directory.  The must be some condition that will fail
>       the find completion due to this but I can't think of any at the
>       moment.

OK.  It looks a bit complicated though, and going back is slow for
some encodings.  gettail_sep() almost does what you want, except that
for "/path/dir/" it will point after "/path/dir" instead of "/path".
I'll make gettail_dir() do this, it might be useful in other places.


> 0004: Delete an "#if defined(MSWIN) || defined(MSDOS)" conditional.
>       I think it is not really needed there because "cutoff" points to a
>       filename produced by globpath and the directory separators should
>       have already been normalized to the platform's path separator.
> 
> 0005: Add a failing test to test73 to show a peculiar behavior of
>       shorten_fname() on windows when used for the shortening the
>       filename.  This test runs fine on unix, but fails on msvc-vim.
> 
> 0006: Work around shorten_fname()'s behavior on windows.  With this
>       change test73 runs successfully.
> 
> 0007: Remove irrelevant comment.

All included, thanks.

-- 
Never go to the toilet in a paperless office.

 /// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net   \\\
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\        download, build and distribute -- http://www.A-A-P.org        ///
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///

-- 
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

Raspunde prin e-mail lui