summaryrefslogtreecommitdiffstats
path: root/contrib/nvi/vi
diff options
context:
space:
mode:
authorsheldonh <sheldonh@FreeBSD.org>2002-01-07 14:26:12 +0000
committersheldonh <sheldonh@FreeBSD.org>2002-01-07 14:26:12 +0000
commit889a3dbc7030de5ba0090d0f89dd8ffa40b2334f (patch)
tree64366af76e5bebccb02cde486c60f78d1cff0fac /contrib/nvi/vi
parent139342447557afcb08884c0f6deb0eaa5c1dd17d (diff)
parentfa30b82df1e06e2a03c19d29525f6b924efdeb0e (diff)
downloadFreeBSD-src-889a3dbc7030de5ba0090d0f89dd8ffa40b2334f.zip
FreeBSD-src-889a3dbc7030de5ba0090d0f89dd8ffa40b2334f.tar.gz
This commit was generated by cvs2svn to compensate for changes in r89010,
which included commits to RCS files with non-trunk default branches.
Diffstat (limited to 'contrib/nvi/vi')
-rw-r--r--contrib/nvi/vi/vs_relative.c20
1 files changed, 12 insertions, 8 deletions
diff --git a/contrib/nvi/vi/vs_relative.c b/contrib/nvi/vi/vs_relative.c
index c92c10c..878fc4f 100644
--- a/contrib/nvi/vi/vs_relative.c
+++ b/contrib/nvi/vi/vs_relative.c
@@ -111,6 +111,15 @@ vs_columns(sp, lp, lno, cnop, diffp)
int ch, leftright, listset;
char *p;
+ /*
+ * Initialize the screen offset.
+ */
+ scno = 0;
+
+ /* Leading number if O_NUMBER option set. */
+ if (O_ISSET(sp, O_NUMBER))
+ scno += O_NUMBER_LENGTH;
+
/* Need the line to go any further. */
if (lp == NULL) {
(void)db_get(sp, lno, 0, &lp, &len);
@@ -122,7 +131,7 @@ vs_columns(sp, lp, lno, cnop, diffp)
if (lp == NULL) {
done: if (diffp != NULL) /* XXX */
*diffp = 0;
- return (0);
+ return scno;
}
/* Store away the values of the list and leftright edit options. */
@@ -130,15 +139,10 @@ done: if (diffp != NULL) /* XXX */
leftright = O_ISSET(sp, O_LEFTRIGHT);
/*
- * Initialize the pointer into the buffer and screen and current
- * offsets.
+ * Initialize the pointer into the buffer and current offset.
*/
p = lp;
- curoff = scno = 0;
-
- /* Leading number if O_NUMBER option set. */
- if (O_ISSET(sp, O_NUMBER))
- scno += O_NUMBER_LENGTH;
+ curoff = 0;
/* Macro to return the display length of any signal character. */
#define CHLEN(val) (ch = *(u_char *)p++) == '\t' && \
OpenPOWER on IntegriCloud