Fwd: Re: bug with 'path'

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Fwd: Re: bug with 'path'

Marian Csontos
I've forgotten to do ``Reply to all'', so I'm forwarding Bram's solution  
to the list too:

> >> I'm trying to set up 'path', but it does not work as expected,
> >>
> >> I'd like to set it up to search in directories
> >> $IDE_ROOT/embedded/**/include,
> >> there is problem with **/ sequence, **\\ should be used instead.
> >> Is this a bug or a feature?
> >
> > Vim should support using / as path separator everywhere.  Backslashes
> > are confusing.
> >
> >> I've found it in both Vim 6.3.86, and 7.0aa.
> >
> > Please give details about the way Vim was compiled.
>
> I'm using Tony's 6.3.86, my system is WinXP SP1:

[..]

> Maybe I should be more verbose too:
> When I try using
> set path=$IDE_ROOT/embedded/**/include
> it end with message E343. It could be solved by using **\\, instead of
> **/, so
> set path=$IDE_ROOT/embedded/**\\include
> works well. But the first case should work too.
>
> And it doesn't work neither with
> gvim -u NONE -U NONE

Ah, "E343" is a good hint.  I see some code that is comparing with
PATHSEP instead of using vim_ispathsep().

This patch might solve it:

*** misc2.c~ Mon Aug  1 22:31:00 2005
--- misc2.c Tue Aug  2 14:04:15 2005
***************
*** 4058,4064 ****
    else
       ff_expand_buffer[len++] = FF_MAX_STAR_STAR_EXPAND;
    wc_part = (char_u *)errpt;
! if (*wc_part != PATHSEP && *wc_part != NUL)
    {
       EMSG2(_("E343: Invalid path: '**[number]' must be at the end of  
the path or be followed by '%s'."), PATHSEPSTR);
       goto error_return;
--- 4058,4064 ----
    else
       ff_expand_buffer[len++] = FF_MAX_STAR_STAR_EXPAND;
    wc_part = (char_u *)errpt;
! if (*wc_part != NUL && !vim_ispathsep(*wc_part))
    {
       EMSG2(_("E343: Invalid path: '**[number]' must be at the end of  
the path or be followed by '%s'."), PATHSEPSTR);
       goto error_return;
***************
*** 4582,4591 ****

       /* cut of last dir */
       while (path_end > ff_search_ctx->ffsc_start_dir
!    && *path_end == PATHSEP)
    path_end--;
       while (path_end > ff_search_ctx->ffsc_start_dir
!    && *(path_end-1) != PATHSEP)
    path_end--;
       *path_end = 0;
       path_end--;
--- 4582,4591 ----

       /* cut of last dir */
       while (path_end > ff_search_ctx->ffsc_start_dir
!    && vim_ispathsep(*path_end))
    path_end--;
       while (path_end > ff_search_ctx->ffsc_start_dir
!    && !vim_ispathsep(path_end[-1]))
    path_end--;
       *path_end = 0;
       path_end--;
***************
*** 5050,5056 ****
       int i = 0;

       /* eat up trailing path separators, except the first */
!     while (path_len > 1 && path[path_len - 1] == PATHSEP)
    path_len--;

       /* if no path consider it as match */
--- 5050,5056 ----
       int i = 0;

       /* eat up trailing path separators, except the first */
!     while (path_len > 1 && vim_ispathsep(path[path_len - 1]))
    path_len--;

       /* if no path consider it as match */
***************
*** 5066,5072 ****
        * '/home/r' would also match '/home/rks'
        */
       if (fnamencmp(stopdirs_v[i], path, path_len) == 0
!    && stopdirs_v[i][path_len] == PATHSEP)
    return TRUE;
    }
    else
--- 5066,5072 ----
        * '/home/r' would also match '/home/rks'
        */
       if (fnamencmp(stopdirs_v[i], path, path_len) == 0
!    && vim_ispathsep(stopdirs_v[i][path_len]))
    return TRUE;
    }
    else



--
Mgr. Mari?n Csontos
program?tor POS
AXA, a.s.
Radni?n? n?mestie 4
821 05 Bratislava
tel. +421 2 4829 4218
mailto:[hidden email]
www.axa.sk
 


________ Information from NOD32 ________
This message was checked by NOD32 Antivirus System for Linux Mail Server.
http://www.nod32.com