Sunday, May 22, 2011

question about string expression evaluation / bug?

I was debugging a problem with a plugin running in Vim73 on Arch Linux
and it seems to stem from an error in string expression evaluation.

In this Vim installation the expression 'xxx' > '' evaluates to 0
(false) while in all other Vims I've seen the expression evaluates (as
it should) to 1 (true).

Does anyone know the explanation for this? The Arch Linux Vim was not
compiled with lots of features built in, but could there really be
some feature that changes the evaluation of string expressions?

Is there some Vim setting (encoding?) that might have changed the
result of this string comparison? It was a plain-jane install of Vim
(nothing of note in vimrc) giving the bad result, didn't see anwhere a
setting could have been changed even if there is some setting that
affects this result.

Thanks for any info.

The string evaluation is in condition of if structure, as below. The
statements between the if/endif are all skipped even when the mystring
variable is non-empty. I traced it in debugger and the if condition
evaluates to zero and execution skips immediately to the endif:
--------------------------------------------
if mystring > ''
" do something here
[. . . ]
endif
------------------------------------------

--
You received this message from the "vim_use" 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

No comments:

Post a Comment