On 22/03/09 14:48, Bram Moolenaar wrote:
[...]
>> 3/ Function complete() returns a String according to ":help functions"
>> but it may return something initialized in case of error.
>> :echo complete('', '') for example prints something uninitialized
>> and valgrind also reports an error.
>>
>> Patch makes it return an empty string in case of error.
>
> I don't think it returns anything useful, might as well be the default
> zero.
IMHO a function which is supposed to return a String should return a
String. Or maybe trigger an exception. Of course, in C on most
processors a pointer-to-string will point to the empty string if the
value pointed to is preset to a zero integer. Are there processors where
the first (lowest-address) byte of a zero integer is other than 0x00?
Maybe some big-endian machines use a kind of skewed arithmetic where
integer plus-zero = 0x80000000 ?
Best regards,
Tony.
--
FIRST SOLDIER: So they wouldn't be able to bring a coconut back anyway.
SECOND SOLDIER: Wait a minute! Suppose two swallows carried it together?
FIRST SOLDIER: No, they'd have to have it on a line.
"Monty Python and the Holy Grail" PYTHON (MONTY)
PICTURES LTD
--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_dev" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---