summary refs log tree commit diff
path: root/Src/Zle/zle_tricky.c
diff options
context:
space:
mode:
authorPeter Stephenson <pws@users.sourceforge.net>2006-08-10 16:34:19 +0000
committerPeter Stephenson <pws@users.sourceforge.net>2006-08-10 16:34:19 +0000
commitd5b3716e1c96cd9529b59f6a31602212e068f223 (patch)
treec3f22baaee6749d8c17f2be781ffb77bcbe1363f /Src/Zle/zle_tricky.c
parent7315dbb38530bbf540d4e8467e58090c25913e01 (diff)
downloadzsh-d5b3716e1c96cd9529b59f6a31602212e068f223.tar.gz
zsh-d5b3716e1c96cd9529b59f6a31602212e068f223.tar.xz
zsh-d5b3716e1c96cd9529b59f6a31602212e068f223.zip
22597: back off two column-subtraction hunks
Diffstat (limited to 'Src/Zle/zle_tricky.c')
-rw-r--r--Src/Zle/zle_tricky.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/Src/Zle/zle_tricky.c b/Src/Zle/zle_tricky.c
index 768d7e34f..fbe04ca5d 100644
--- a/Src/Zle/zle_tricky.c
+++ b/Src/Zle/zle_tricky.c
@@ -2175,7 +2175,12 @@ printfmt(char *fmt, int n, int dopr, int doesc)
 		putc(' ', shout);
 	}
     }
-    return l + ((cc-1) / columns);
+    /*
+     * Experiments suggest that at this point not subtracting 1 from
+     * cc is correct, i.e. if just misses wrapping we still add 1.
+     * (Why?)
+     */
+    return l + (cc / columns);
 }
 
 /* This is used to print expansions. */