summary refs log tree commit diff
diff options
context:
space:
mode:
authorWayne Davison <wayned@users.sourceforge.net>2005-12-12 18:35:47 +0000
committerWayne Davison <wayned@users.sourceforge.net>2005-12-12 18:35:47 +0000
commita2e7cbe30825b1a81d6c93a056b229fd044face0 (patch)
tree46e28df13ca7ef5ccea632ac9220811bec111524
parente0c9faba4df38b0000b3c1f2a5d88ba723adea86 (diff)
downloadzsh-a2e7cbe30825b1a81d6c93a056b229fd044face0.tar.gz
zsh-a2e7cbe30825b1a81d6c93a056b229fd044face0.tar.xz
zsh-a2e7cbe30825b1a81d6c93a056b229fd044face0.zip
A slightly more optimal way to fix the zle_setline() bug using
the same zlecs-checking idiom as setline().
-rw-r--r--Src/Zle/zle_hist.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/Src/Zle/zle_hist.c b/Src/Zle/zle_hist.c
index a61f7f59e..31fa6ace0 100644
--- a/Src/Zle/zle_hist.c
+++ b/Src/Zle/zle_hist.c
@@ -669,8 +669,7 @@ zle_setline(Histent he)
 	zleline = zalloc((zlell + 2) * ZLE_CHAR_SIZE);
 	ZS_memcpy(zleline, he->zle_text, zlell);
 
-	zlecs = zlell;
-	if (zlecs > findbol() && invicmdmode())
+	if ((zlecs = zlell) && invicmdmode())
 	    zlecs--;
     } else {
 	setline(he->text, ZSL_COPY|ZSL_TOEND);