From: Vitezslav S. <sa...@ma...> - 2003-01-29 17:03:22
|
Hi! > Sorry for not taking time to go through the sourceforge bug/patch-o-matic, > please bare with me. for me this (mailing list) is preferable. > There seems to be a nasty bug in JOE when ^O and ^W reach outside of the > text boundary, causing it to enter an endless loop and forcing you to kill > the process. > > Start up JOE - type "foo bar" without pressing enter, place the cursor at > row 1 ("f"), and press ^W, "foo" is deleted, press ^W again, the " " is > deleted, and ^W yet another time, and JOE hangs. Same thing with ^O, type > some random text, move to the end of the line, and use ^O to delete it all, > when it reach the last (first) word in the editor it will cause JOE to > freeze. This does not apply if the last thing you delete with ^O or ^W is > whitespace. > > (Heh, the funny thing is I had not noticed this before because all this time > I thought I had pressed ctrl+s by mistake since it's very close to ctrl+w, > and blamed my terminal for ctrl+q not working. ;-) > > Anyhow, I checked out the latest cvs and it seems like isalnum_ in utils.c > might be a bit broken since it cause u_word_delete() and ubackw() in uedit.c > to loop forever in their "while (isalnum_(c = getchar...)" in the above > scenario. > > As far as I can tell, this should fix it without breaking any other code > where isalnum_ is used, but the maintainers might want to look it over > anyway: > > > $ diff -u utils.org.c utils.c > --- utils.org.c Wed Jan 29 16:19:02 2003 > +++ utils.c Wed Jan 29 16:19:02 2003 > @@ -74,7 +74,7 @@ > */ > unsigned int isalnum_(unsigned int c) > { > - return (isalnum(c) || (c == 95)); > + return ((isalnum(c) || (c == 95)) && (c != MAXINT)); > } > > /* Versions of 'read' and 'write' which automatically retry when interrupted */ Thanks for bug report, I will look at it if I find a spare time. Cheers, Vita |