From 6066bd7eeb64b131d1e05a6f04f1304e334e36c7 Mon Sep 17 00:00:00 2001 From: Wayne Davison Date: Thu, 10 May 2001 23:06:54 +0000 Subject: [PATCH] Fixed an obscure local-history bug that could make the "history" command output something that was slightly wrong. (14304) --- Src/hist.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/Src/hist.c b/Src/hist.c index 58fe748be..f662ed9af 100644 --- a/Src/hist.c +++ b/Src/hist.c @@ -1067,8 +1067,6 @@ hend(Eprog prog) Histent he; int keepflags; - for (he = hist_ring; he && he->flags & hist_skip_flags; - he = up_histent(he)) ; #ifdef DEBUG /* debugging only */ if (chwordpos%2) { @@ -1083,13 +1081,14 @@ hend(Eprog prog) if (isset(HISTREDUCEBLANKS)) histreduceblanks(); } - if ((isset(HISTIGNOREDUPS) || isset(HISTIGNOREALLDUPS)) && he - && histstrcmp(chline, he->text) == 0) { + if ((isset(HISTIGNOREDUPS) || isset(HISTIGNOREALLDUPS)) && hist_ring + && histstrcmp(chline, hist_ring->text) == 0) { /* This history entry compares the same as the previous. * In case minor changes were made, we overwrite the * previous one with the current one. This also gets the * timestamp right. Perhaps, preserve the HIST_OLD flag. */ + he = hist_ring; keepflags = he->flags & HIST_OLD; /* Avoid re-saving */ freehistdata(he, 0); curline.histnum = curhist;