plan9port/src/cmd/acme
Russ Cox 50ababbd55 acme: fix bufread crash due to typing-point scrolling
Acme tracks the most recent typing insertion point and
the home and end keys stop there on their way
up to the top or down to the bottom of the file.
That point should be iq1, and it should be adjusted
properly so that it's always between 0 and t->file->b.nc inclusive.
(This is all code from an external contributor, years old at this
point but new since Plan 9.)

Somehow, sometimes iq1 ends up a little beyond b.nc,
and when passed to textbacknl it crashes acme in bufread.
I can't see how that can happen but if it does, avoid the crash.

It's tempting to pull the insertion point code out entirely
but this is a little less invasive and should fix things for now.

TBR=rsc
https://codereview.appspot.com/107730043
2014-06-03 00:16:48 -04:00
..
mail acme Mail: add Search command 2013-09-06 16:19:57 -04:00
acme.c acme: add log file in acme root directory 2014-04-30 12:14:29 -04:00
addr.c acme: allow :6 in 5-line file 2013-07-31 09:15:30 -04:00
buff.c Use gcc -ansi -pedantic in 9c. Fix many non-C89-isms. 2006-04-01 19:24:03 +00:00
cols.c acme: mouse movement for Del 2012-09-23 22:01:56 -04:00
dat.h acme: add log file in acme root directory 2014-04-30 12:14:29 -04:00
disk.c acme, sam: handle >1GB files correctly 2014-03-13 18:46:28 -04:00
ecmd.c acme: let Edit redo when file is clean 2010-01-12 11:11:19 -08:00
edit.c acme: fix off by one in editcmd, pointer comparison in getch, nextc 2010-07-14 11:08:42 -07:00
edit.h acme: sync against Plan 9, remove -$ option 2008-03-07 10:45:59 -05:00
elog.c acme: fix owner bug in elogapply 2008-06-01 09:11:21 -04:00
exec.c acme: add log file in acme root directory 2014-04-30 12:14:29 -04:00
file.c Use gcc -ansi -pedantic in 9c. Fix many non-C89-isms. 2006-04-01 19:24:03 +00:00
fns.h acme: mouse movement for Del 2012-09-23 22:01:56 -04:00
fsys.c acme: add log file in acme root directory 2014-04-30 12:14:29 -04:00
logf.c acme: fix two flush bugs in new log file 2014-05-05 22:28:03 -04:00
look.c acme: add log file in acme root directory 2014-04-30 12:14:29 -04:00
mkfile acme: add log file in acme root directory 2014-04-30 12:14:29 -04:00
regx.c acme, sam: fix regexp code for bigger Runemax 2010-07-14 11:10:59 -07:00
rows.c acme: add log file in acme root directory 2014-04-30 12:14:29 -04:00
scrl.c Use gcc -ansi -pedantic in 9c. Fix many non-C89-isms. 2006-04-01 19:24:03 +00:00
text.c acme: fix bufread crash due to typing-point scrolling 2014-06-03 00:16:48 -04:00
time.c acme: increase timer resolution to 10ms 2014-06-03 00:09:29 -04:00
util.c acme: add log file in acme root directory 2014-04-30 12:14:29 -04:00
wind.c acme: add log file in acme root directory 2014-04-30 12:14:29 -04:00
xfid.c acme: add log file in acme root directory 2014-04-30 12:14:29 -04:00