Loading ...
Sorry, an error occurred while loading the content.

Fwd: Re: bug with 'path'

Expand Messages
  • Marian Csontos
    ... I m using Tony s 6.3.86, my system is WinXP SP1: VIM - Vi IMproved 6.3 (2004 June 7, compiled Jul 29 2005 16:23:08) MS-Windows 32 bit GUI version with OLE
    Message 1 of 2 , Aug 2, 2005
    • 0 Attachment
      Bram Moolenaar wrote:
      >
      > Marian Csontos wrote:
      >
      >> 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:

      VIM - Vi IMproved 6.3 (2004 June 7, compiled Jul 29 2005 16:23:08)
      MS-Windows 32 bit GUI version with OLE support
      Included patches: 1-86
      Compiled by antoine.mechelynck@...
      Big version with GUI. Features included (+) or not (-):
      +arabic +autocmd +balloon_eval +browse ++builtin_terms +byte_offset
      +cindent +clientserver +clipboard +cmdline_compl +cmdline_hist
      +cmdline_info
      +comments +cryptv +cscope +dialog_con_gui +diff +digraphs -dnd -ebcdic
      +emacs_tags +eval +ex_extra +extra_search +farsi +file_in_path
      +find_in_path
      +folding -footer +gettext/dyn -hangul_input +iconv/dyn +insert_expand
      +jumplist +keymap +langmap +libcall +linebreak +lispindent +listcmds
      +localmap
      +menu +mksession +modify_fname +mouse +mouseshape +multi_byte_ime/dyn
      +multi_lang +netbeans_intg +ole -osfiletype +path_extra +perl/dyn
      -postscript
      +printer +python/dyn +quickfix +rightleft +ruby/dyn +scrollbind +signs
      +smartindent -sniff +statusline -sun_workshop +syntax +tag_binary
      +tag_old_static
      -tag_any_white +tcl/dyn -tgetent -termresponse +textobjects +title
      +toolbar +user_commands +vertsplit +virtualedit +visual +visualextra
      +viminfo
      +vreplace +wildignore +wildmenu +windows +writebackup -xfontset -xim
      -xterm_save -xpm_w32
      system vimrc file: "$VIM\vimrc"
      user vimrc file: "$HOME\_vimrc"
      2nd user vimrc file: "$VIM\_vimrc"
      user exrc file: "$HOME\_exrc"
      2nd user exrc file: "$VIM\_exrc"
      system gvimrc file: "$VIM\gvimrc"
      user gvimrc file: "$HOME\_gvimrc"
      2nd user gvimrc file: "$VIM\_gvimrc"
      system menu file: "$VIMRUNTIME\menu.vim"
      Compilation: gcc -O3 -fomit-frame-pointer -freg-struct-return
      -malign-double -fno-strength-reduce -DWIN32 -DHAVE_PATHDEF -DFEAT_BIG
      -DWINVER=0x0400 -D_WIN32_WINNT=0x0400 -DFEAT_PERL -DDYNAMIC_PERL
      -DDYNAMIC_PERL_DLL="perl58.dll" -DFEAT_PYTHON -DDYNAMIC_PYTHON
      -DDYNAMIC_PYTHON_DLL="python24.dll" -DFEAT_RUBY -DDYNAMIC_RUBY
      -DDYNAMIC_RUBY_DLL="msvcrt-ruby18.dll" -DDYNAMIC_RUBY_VER=18 -DFEAT_TCL
      -DDYNAMIC_TCL -DDYNAMIC_TCL_DLL="tcl83.dll" -DDYNAMIC_GETTEXT
      -DDYNAMIC_ICONV -DFEAT_MBYTE -DFEAT_MBYTE_IME -DDYNAMIC_IME -DFEAT_CSCOPE
      -DFEAT_NETBEANS_INTG -DFEAT_OLE -DFEAT_GUI_W32 -DFEAT_CLIPBOARD -mcpu=i386
      -march=i386 -Iproto -I/cygdrive/c/Perl/lib/CORE
      -I/cygdrive/c/Python24/include
      -I/cygdrive/c/ruby/lib/ruby/1.8/i386-mswin32 -I/cygdrive/c/ruby/include -s
      -mno-cygwin
      Linking: gcc -s -o gvim.exe -luuid -lole32
      /cygdrive/c/ruby/lib/tclstub83.lib -lwsock32 -loleaut32 -lstdc++ -mwindows
      -lcomctl32


      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

      Regards

      -- Marian


      ________ Information from NOD32 ________
      This message was checked by NOD32 Antivirus System for Linux Mail Server.
      http://www.nod32.com
    • Marian Csontos
      I ve forgotten to do ``Reply to all , so I m forwarding Bram s solution ... [..] ... Ah, E343 is a good hint. I see some code that is comparing with
      Message 2 of 2 , Aug 2, 2005
      • 0 Attachment
        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:csontos@...
        www.axa.sk



        ________ Information from NOD32 ________
        This message was checked by NOD32 Antivirus System for Linux Mail Server.
        http://www.nod32.com
      Your message has been successfully submitted and would be delivered to recipients shortly.