Jan Hnatek wrote:
>
> Chet Ramey wrote:
>> So what does the Solaris mbrtowc return in this case? The flow of that
>> particular section of code isn't that great (bash-4.0 is better), but it
>> seems to me that point can only increase. If mbrtowc returns -2, the
>> loop won't be entered at all.
>
> I've checked it and looks to do the following
> (correct me if I'm wrong):
> - tmp is unsigned
> - mbrtowc returns -2
> - tmp > 0 is true and loop is entered
Sure, but tmp is unsigned. It must be integer promotion happening
that I overlooked.
Try the bash-4.0/readline-6.0 version of the code, which I've attached.
Chet
--
``The lyf so short, the craft so long to lerne.'' - Chaucer
Chet Ramey, ITS, CWRU chet@case.edu http://cnswww.cns.cwru.edu/~chet/