[Vim-vms] Re: Vim 6.2 crash

Bram Moolenaar Bram at moolenaar.net
Tue Jan 13 17:09:33 CET 2004


Coen Engelbarts wrote:

> For the vim-dev readers:
> Does the file name expansion use vim's regexp code?
> Can you tell me which function or source file does the file name expansion?

Yes, the regexp engine is used for finding matching file names.  Except
when a machine-specific function should be used.  gen_expand_wildcards()
is the central function.

> I think I found a new bug in vim/VMS 6.2.106 (I use the downloaded
> binary from http://www.polarfox.com/vim/).
> The following actions consistently crash vim:
> In the VIM directory, start vim and type:
>      :n syntax/<CTRL-D>
> For a few moments the prompt will show
>      :n syntax/...
> and finally
>      :n \[.syntax]2html.vim
> If you now press <CTRL-D> or <TAB>, vim will crash:
>      Vim: Caught deadly signal BUS
> 
>      Vim: Finished.
> 
> In short, the command:
>      :n \[.syntax]<CTRL-D>
> crashes vim on VMS.
> 
> I do not understand how/why/where vim inserts the '\' before the '[' and 
> not before the ']'. I don't think that vim needs it to understand VMS 
> path names.
> AFAIK, escaping '[' to '\[' is only necessary in regular expressions. 
> Does the file name expansion use vim's regexp code?

Using [] is a generic thing in filenames, just like using "*" and "?".
Therefore a backslash is needed for a literal "[".  It's not needed for
the "]", because it only has a special meaning after a "[".

> The function vms_unix_mixed_filespec() in os_vms.c expands pathnames 
> from Unix to VMS format, but it does not seem to insert a '\'.
> The line
>      *out++ = '[';	    /* Yes, denote a Vms subdirectory */
> looked suspicious to me, but I think the *out++ should correctly write 
> '[' before incrementing 'out' (see e.g. 
> http://www.eskimo.com/~scs/C-faq/q4.3.html)
> 
> Does anybody know what's happening?

The escaping is done in ExpandEscape().

Anyway, even when inserting a backslash is not appropriate (which I
still think is right), Vim should not crash.  I hope you can find out
where the crash happens.

-- 
hundred-and-one symptoms of being an internet addict:
269. You receive an e-mail from the wife of a deceased president, offering
     to send you twenty million dollar, and you are not even surprised.

 /// Bram Moolenaar -- Bram at Moolenaar.net -- http://www.Moolenaar.net   \\\
///        Sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\              Project leader for A-A-P -- http://www.A-A-P.org        ///
 \\\  Help AIDS victims, buy here: http://ICCF-Holland.org/click1.html  ///



More information about the Vim-vms mailing list