Avoid failed history erase mode

OBS-URL: https://build.opensuse.org/package/show/shells/tcsh?expand=0&rev=157
This commit is contained in:
Dr. Werner Fink 2023-07-21 12:26:09 +00:00 committed by Git OBS Bridge
parent 97243fe091
commit 760b8e23d6

View File

@ -1,19 +1,27 @@
--- ---
sh.hist.c | 4 ++-- sh.hist.c | 5 +++--
1 file changed, 2 insertions(+), 2 deletions(-) 1 file changed, 3 insertions(+), 2 deletions(-)
--- sh.hist.c --- sh.hist.c
+++ sh.hist.c 2023-07-21 09:38:31.303857784 +0000 +++ sh.hist.c 2023-07-21 12:21:55.518480015 +0000
@@ -64,7 +64,7 @@ static void hfree (struct Hist *); @@ -64,7 +64,7 @@ static void hfree (struct Hist *);
/* #define DEBUG_HIST 1 */ /* #define DEBUG_HIST 1 */
-static const int fastMergeErase = 1; -static const int fastMergeErase = 1;
+static const int fastMergeErase = 0; /* Was true, now false to merge even with full history list */ +static int fastMergeErase = 1;
static unsigned histCount = 0; /* number elements on history list */ static unsigned histCount = 0; /* number elements on history list */
static int histlen = 0; static int histlen = 0;
static struct Hist *histTail = NULL; /* last element on history list */ static struct Hist *histTail = NULL; /* last element on history list */
@@ -1393,7 +1393,7 @@ loadhist(Char *fname, int mflg) @@ -1321,6 +1321,7 @@ rechist(Char *xfname, int ref)
}
if (merge) {
+ fastMergeErase = 0; /* Was true, now false to merge even with full history list */
jmp_buf_t osetexit;
if (lock) {
#ifndef WINNT_NATIVE
@@ -1393,7 +1394,7 @@ loadhist(Char *fname, int mflg)
/* During history merging (enthist sees mflg set), we disable management of /* During history merging (enthist sees mflg set), we disable management of
* Hnum and Href (because fastMergeErase is true). So now reset all the * Hnum and Href (because fastMergeErase is true). So now reset all the
* values based on the final ordering of the history list. */ * values based on the final ordering of the history list. */