2023-07-14 13:31:09 +02:00
|
|
|
---
|
2023-07-21 14:26:09 +02:00
|
|
|
sh.hist.c | 5 +++--
|
|
|
|
1 file changed, 3 insertions(+), 2 deletions(-)
|
2023-07-14 13:31:09 +02:00
|
|
|
|
|
|
|
--- sh.hist.c
|
2023-07-21 14:26:09 +02:00
|
|
|
+++ sh.hist.c 2023-07-21 12:21:55.518480015 +0000
|
2023-07-21 13:26:28 +02:00
|
|
|
@@ -64,7 +64,7 @@ static void hfree (struct Hist *);
|
2023-07-14 13:31:09 +02:00
|
|
|
|
2023-07-21 13:26:28 +02:00
|
|
|
/* #define DEBUG_HIST 1 */
|
2023-07-14 13:31:09 +02:00
|
|
|
|
2023-07-21 13:26:28 +02:00
|
|
|
-static const int fastMergeErase = 1;
|
2023-07-21 14:26:09 +02:00
|
|
|
+static int fastMergeErase = 1;
|
2023-07-21 13:26:28 +02:00
|
|
|
static unsigned histCount = 0; /* number elements on history list */
|
|
|
|
static int histlen = 0;
|
|
|
|
static struct Hist *histTail = NULL; /* last element on history list */
|
2023-07-21 14:26:09 +02:00
|
|
|
@@ -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)
|
2023-07-21 13:26:28 +02:00
|
|
|
/* During history merging (enthist sees mflg set), we disable management of
|
|
|
|
* Hnum and Href (because fastMergeErase is true). So now reset all the
|
|
|
|
* values based on the final ordering of the history list. */
|
|
|
|
- if (mflg) {
|
|
|
|
+ if (mflg && fastMergeErase) {
|
|
|
|
int n = eventno;
|
|
|
|
struct Hist *hp = &Histlist;
|
|
|
|
while ((hp = hp->Hnext))
|