Hi all,

On 5/1/06, Benji Fisher <[EMAIL PROTECTED]> wrote:
On Tue, May 02, 2006 at 12:13:37AM +0200, Bram Moolenaar wrote:
>
> Bad example...  I meant that there are scripts that are too big to
> check.

     I tried

:vimgrep /exists[^)]*\*/ $VIMRUNTIME/**/*.vim
:cl

and found that there are 111 matches.  If all we are worried about is
exists("*<string>") where <string> contains non-'isk' characters, then I
am willing to check them.  I bet there are very few.


Thanks Benji for doing this. After Bram mentioned netrw.vim yesterday,
I took a look at where all it uses exists('*fun') and it looks like
netrw.vim might also be bitten by the same bug which is troubling me...

In netrwfilehandlers.vim, line 32 is

 if a:exten != "" && exists("*s:NFH_".a:exten)

so if the user is for some reason looking at a file which has non-'isk'
characters in its extension (for example, CVS ",v" files), then the
above will fail. I cannot generate a test case which fails because it
looks like netrw.vim automatically invokes rundll32,FileProtocolHandler
when has('win32'), however, the following call:

call netrwFileHandlers#Invoke('png,v', 'file.png')

produces the expected error (instead of just failing gracefully):

--------------------------------%<--------------------------------
Error detected while processing function netrwFileHandlers#Invoke:
line    5:
E121: Undefined variable: s:NFH_png
E15: Invalid expression: s:NFH_png,v("transmission4bar.png")
--------------------------------%<--------------------------------

I think this is another argument in favor of fixing bugs and letting
unintended behavior produce bugs rather than work for "mysterious"
reasons.

Thanks,
Srinath

Reply via email to