aboutsummaryrefslogtreecommitdiffstats
path: root/vi/vs_relative.c
diff options
context:
space:
mode:
authorBaptiste Daroussin <bapt@FreeBSD.org>2020-10-01 04:25:54 +0000
committerBaptiste Daroussin <bapt@FreeBSD.org>2020-10-01 04:25:54 +0000
commitb4ed613595432ece6802d09bfabad18e09aa26f3 (patch)
treebd2db6b09b756624c1b2babdd12ea05a9dffcdaf /vi/vs_relative.c
parent7cef6c685d23e4dcdf3f64b0b2ea92151e652db6 (diff)
downloadsrc-vendor/nvi.tar.gz
src-vendor/nvi.zip
Import nvi 2.2.0-05ed8b9vendor/nvi/2.2.0-05ed8b9vendor/nvi
This snapshot just brings a bunch of fixes in particular a fix for vi -w PR: 241985 Reported by: fernape
Notes
Notes: svn path=/vendor/nvi/dist/; revision=366307 svn path=/vendor/nvi/2.2.0-05ed8b9/; revision=366308; tag=vendor/nvi/2.2.0-05ed8b9
Diffstat (limited to 'vi/vs_relative.c')
-rw-r--r--vi/vs_relative.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/vi/vs_relative.c b/vi/vs_relative.c
index 5df8c3c3f22d..353dcbe9d572 100644
--- a/vi/vs_relative.c
+++ b/vi/vs_relative.c
@@ -142,15 +142,16 @@ done: if (diffp != NULL) /* XXX */
* last column of the screen. Otherwise, display the rest of the
* character in the next screen.
*/
-#define TAB_RESET { \
+#define TAB_RESET do { \
curoff += chlen; \
- if (!leftright && curoff >= sp->cols) \
+ if (!leftright && curoff >= sp->cols) { \
if (ch == '\t') { \
curoff = 0; \
scno -= scno % sp->cols; \
} else \
curoff -= sp->cols; \
-}
+ } \
+} while (0)
if (cnop == NULL)
while (len--) {
chlen = CHLEN(curoff);