From 89eb92d8c270561a5f7d6e24114b3febf3078e24 Mon Sep 17 00:00:00 2001 From: Wayne Davison Date: Fri, 1 Oct 2004 19:48:53 +0000 Subject: - Added an arg to saveandpophiststack() to allow the caller to specify what flags to send to savehistfile(). - Implemented the HFILE_NO_REWRITE support in savehistfile(). --- Src/hist.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'Src') diff --git a/Src/hist.c b/Src/hist.c index 74b302cff..da1e15ccc 100644 --- a/Src/hist.c +++ b/Src/hist.c @@ -2093,7 +2093,8 @@ savehistfile(char *fn, int err, int writeflags) } fclose(out); - if ((writeflags & (HFILE_SKIPOLD | HFILE_FAST)) == HFILE_SKIPOLD) { + if (writeflags & HFILE_SKIPOLD + && !(writeflags & (HFILE_FAST | HFILE_NO_REWRITE))) { int remember_histactive = histactive; /* Zeroing histactive avoids unnecessary munging of curline. */ @@ -2445,7 +2446,7 @@ pophiststack(void) /**/ int -saveandpophiststack(int pop_through) +saveandpophiststack(int pop_through, int writeflags) { if (pop_through <= 0) { pop_through += histsave_stack_pos + 1; @@ -2459,7 +2460,7 @@ saveandpophiststack(int pop_through) return 0; do { if (!nohistsave) - savehistfile(NULL, 1, HFILE_USE_OPTIONS); + savehistfile(NULL, 1, writeflags); pophiststack(); } while (histsave_stack_pos >= pop_through); return 1; -- cgit 1.4.1