From: Vitezslav S. <sa...@ma...> - 2001-11-05 09:08:12
|
On Wed, Oct 31, 2001 at 04:39:41PM +0100, Moritz Barsnick wrote: > Hi, > > I use joe as my $EDITOR. Very often recently, when writing emails in > mutt (like this one), when I exit joe using "^K X", joe seems to hang. > I get no response from the console, and am still seeing the joe > "window". Yet "ps" says joe is still "running" ("R"): > > eedmoba 8976 0.1 0.2 1000 824 pts/0 S 16:27:29 0:00 grep joe > eedmoba 8915 36.9 0.3 1688 1448 pts/1 R 16:21:52 0:10 joe -nobackups /tmp/mutt-sun98-8913-0 > eedmoba 8914 0.0 0.2 944 776 pts/1 S 16:21:52 0:00 sh -c joe -nobackups '/tmp/mutt-sun98-8913-0' > > If I kill joe with "-3" (the nicest possible way), I return to mutt > properly, and my file was also saved properly by joe... OTOH, the > "^K X" seems to have stuck, it lands inside mutt. Seems like infinite loop somewhere. I found one, so, please, try the following patch (against-2.9.7-pre3) and report success/failure. Cheers, Vita diff -urN -X dontdiff 01-pid_t/ufile.c 02-dosave/ufile.c --- 01-pid_t/ufile.c Sun Oct 21 19:32:46 2001 +++ 02-dosave/ufile.c Sun Nov 4 12:57:59 2001 @@ -303,14 +303,17 @@ * 24 Apr 2001, Marx */ UNDO *u = bw->b->undo; - UNDOREC *rec = u->recs.link.prev; - - while (rec->changed) { + UNDOREC *rec, *rec_start; + + rec = rec_start = &u->recs; + + do { rec = rec->link.prev; - } - rec->changed = 1; - } + } while (rec != rec_start && rec->changed); + if(rec->changed == 0) + rec->changed = 1; + } genexmsg(bw, 1, req->name); vsrm(req->name); free(req); |