tacme: allow :6 in 5-line file - plan9port - [fork] Plan 9 from user space
(HTM) git clone git://src.adamsgaard.dk/plan9port
(DIR) Log
(DIR) Files
(DIR) Refs
(DIR) README
(DIR) LICENSE
---
(DIR) commit 2bc9a13faf0abcfa43cddc8c226b2f742b764c4a
(DIR) parent d74fdb6edbedbb184de9a8230e156460cb609aa6
(HTM) Author: Russ Cox <rsc@swtch.com>
Date: Wed, 31 Jul 2013 09:15:30 -0400
acme: allow :6 in 5-line file
R=rsc
https://codereview.appspot.com/12162043
Diffstat:
M src/cmd/acme/addr.c | 2 ++
1 file changed, 2 insertions(+), 0 deletions(-)
---
(DIR) diff --git a/src/cmd/acme/addr.c b/src/cmd/acme/addr.c
t@@ -77,6 +77,8 @@ number(uint showerr, Text *t, Range r, int line, int dir, int size, int *evalp)
if(textreadc(t, q1++) == '\n' || q1==t->file->b.nc)
if(--line > 0)
q0 = q1;
+ if(line==1 && q1==t->file->b.nc) // 6 goes to end of 5-line file
+ break;
if(line > 0)
goto Rescue;
break;