summaryrefslogtreecommitdiff
path: root/usr.bin/mg
diff options
context:
space:
mode:
authorTodd C. Miller <millert@cvs.openbsd.org>2001-02-12 21:51:56 +0000
committerTodd C. Miller <millert@cvs.openbsd.org>2001-02-12 21:51:56 +0000
commit039f1b028e913449bc2e3498cb30d6f0025ff71c (patch)
treebe1da4fa299c107f7c3be3ae195aa70254debaa5 /usr.bin/mg
parent091ee1d067d0e1b60bbf3ae2468b2816572f4d9b (diff)
goto-line 0 should go to the beginning of the file, not the end;
smart@monkey.org
Diffstat (limited to 'usr.bin/mg')
-rw-r--r--usr.bin/mg/basic.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/usr.bin/mg/basic.c b/usr.bin/mg/basic.c
index b4dc605fd5c..285a9cbc0b2 100644
--- a/usr.bin/mg/basic.c
+++ b/usr.bin/mg/basic.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: basic.c,v 1.4 2001/01/29 01:58:06 niklas Exp $ */
+/* $OpenBSD: basic.c,v 1.5 2001/02/12 21:51:55 millert Exp $ */
/*
* Basic cursor motion commands.
@@ -466,15 +466,15 @@ gotoline(f, n)
return s;
n = atoi(buf);
}
- if (n > 0) {
- clp = lforw(curbp->b_linep); /* "clp" is first line */
+ if (n >= 0) {
+ clp = lforw(curbp->b_linep); /* "clp" is first line */
while (--n > 0) {
if (lforw(clp) == curbp->b_linep)
break;
clp = lforw(clp);
}
} else {
- clp = lback(curbp->b_linep); /* clp is last line */
+ clp = lback(curbp->b_linep); /* "clp" is last line */
while (n < 0) {
if (lback(clp) == curbp->b_linep)
break;