summaryrefslogtreecommitdiff
path: root/usr.bin
diff options
context:
space:
mode:
authorFlorian Obser <florian@cvs.openbsd.org>2014-03-27 09:30:56 +0000
committerFlorian Obser <florian@cvs.openbsd.org>2014-03-27 09:30:56 +0000
commitb657aa86a98fb73c16ab7d0fe8d670aee8d59cf4 (patch)
tree2f9333f1a8be02fe53168e69e3bebcd1f9b2e483 /usr.bin
parentd85d83c7de89f1f110354bbb80a6d9e6b2657fc8 (diff)
Don't use nospace uninitialized in gotobop and gotoeop.
Problem noticed and diff from bcallah@. Slightly different fix by me. OK lum@, bcallah@
Diffstat (limited to 'usr.bin')
-rw-r--r--usr.bin/mg/paragraph.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/usr.bin/mg/paragraph.c b/usr.bin/mg/paragraph.c
index 842462990f9..d45efc4e97a 100644
--- a/usr.bin/mg/paragraph.c
+++ b/usr.bin/mg/paragraph.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: paragraph.c,v 1.30 2014/03/20 07:47:29 lum Exp $ */
+/* $OpenBSD: paragraph.c,v 1.31 2014/03/27 09:30:55 florian Exp $ */
/* This file is in the public domain. */
@@ -33,6 +33,7 @@ gotobop(int f, int n)
return (gotoeop(f, -n));
while (n-- > 0) {
+ nospace = 0;
while (lback(curwp->w_dotp) != curbp->b_headp) {
curwp->w_dotp = lback(curwp->w_dotp);
curwp->w_dotline--;
@@ -49,7 +50,6 @@ gotobop(int f, int n)
} else
nospace = 1;
}
- nospace = 0;
}
/* force screen update */
curwp->w_rflag |= WFMOVE;
@@ -72,6 +72,7 @@ gotoeop(int f, int n)
/* for each one asked for */
while (n-- > 0) {
+ nospace = 0;
while (lforw(curwp->w_dotp) != curbp->b_headp) {
col = 0;
curwp->w_doto = 0;
@@ -89,7 +90,6 @@ gotoeop(int f, int n)
curwp->w_dotp = lforw(curwp->w_dotp);
curwp->w_dotline++;
}
- nospace = 0;
}
/* force screen update */
curwp->w_rflag |= WFMOVE;