summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog3
-rw-r--r--Src/Zle/zle_hist.c12
2 files changed, 12 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog
index bb66ce39a..b4bb526d7 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
2008-05-11 Peter Stephenson <p.w.stephenson@ntlworld.com>
+ * 24994: Src/Zle/zle_hist.c: Fix problem with
+ up/down-line-or-search comparison, perhaps.
+
* 24990: Stephane Chazelas: Functions/Misc/zmv: fix
various little quirks in zmv.
diff --git a/Src/Zle/zle_hist.c b/Src/Zle/zle_hist.c
index 54c103f60..85c149929 100644
--- a/Src/Zle/zle_hist.c
+++ b/Src/Zle/zle_hist.c
@@ -111,7 +111,7 @@ zlinecmp(const char *histp, const char *inputp)
mbstate_t hstate, istate;
#endif
- while (*hptr == *iptr) {
+ while (*iptr && *hptr == *iptr) {
hptr++;
iptr++;
}
@@ -470,13 +470,15 @@ historysearchbackward(char **args)
if (!(he = quietgethist(histline)))
return 1;
+ metafy_line();
while ((he = movehistent(he, -1, hist_skip_flags))) {
if (isset(HISTFINDNODUPS) && he->node.flags & HIST_DUP)
continue;
zt = GETZLETEXT(he);
if (zlinecmp(zt, str) < 0 &&
- (*args || strcmp(zt, str) != 0)) {
+ (*args || strcmp(zt, zlemetaline) != 0)) {
if (--n <= 0) {
+ unmetafy_line();
zle_setline(he);
srch_hl = histline;
srch_cs = zlecs;
@@ -484,6 +486,7 @@ historysearchbackward(char **args)
}
}
}
+ unmetafy_line();
return 1;
}
@@ -524,13 +527,15 @@ historysearchforward(char **args)
if (!(he = quietgethist(histline)))
return 1;
+ metafy_line();
while ((he = movehistent(he, 1, hist_skip_flags))) {
if (isset(HISTFINDNODUPS) && he->node.flags & HIST_DUP)
continue;
zt = GETZLETEXT(he);
if (zlinecmp(zt, str) < (he->histnum == curhist) &&
- (*args || strcmp(zt, str) != 0)) {
+ (*args || strcmp(zt, zlemetaline) != 0)) {
if (--n <= 0) {
+ unmetafy_line();
zle_setline(he);
srch_hl = histline;
srch_cs = zlecs;
@@ -538,6 +543,7 @@ historysearchforward(char **args)
}
}
}
+ unmetafy_line();
return 1;
}