aboutsummaryrefslogtreecommitdiff
path: root/contrib
diff options
context:
space:
mode:
Diffstat (limited to 'contrib')
-rw-r--r--contrib/nvi/ex/ex_txt.c4
-rw-r--r--contrib/nvi/vi/v_txt.c6
2 files changed, 6 insertions, 4 deletions
diff --git a/contrib/nvi/ex/ex_txt.c b/contrib/nvi/ex/ex_txt.c
index 2f62ff51a47c..30bcf977f3f0 100644
--- a/contrib/nvi/ex/ex_txt.c
+++ b/contrib/nvi/ex/ex_txt.c
@@ -398,8 +398,8 @@ txt_dent(sp, tp)
++scno;
/* Get the previous shiftwidth column. */
- cno = scno;
- scno -= --scno % sw;
+ cno = scno--;
+ scno -= scno % sw;
/*
* Since we don't know what comes before the character(s) being
diff --git a/contrib/nvi/vi/v_txt.c b/contrib/nvi/vi/v_txt.c
index 4a3e80a181d6..0cb1ff5a89a7 100644
--- a/contrib/nvi/vi/v_txt.c
+++ b/contrib/nvi/vi/v_txt.c
@@ -1956,8 +1956,10 @@ txt_dent(sp, tp, isindent)
target = current;
if (isindent)
target += COL_OFF(target, sw);
- else
- target -= --target % sw;
+ else {
+ --target;
+ target -= target % sw;
+ }
/*
* The AI characters will be turned into overwrite characters if the