1
0
Fork 0
mirror of git://git.code.sf.net/p/zsh/code synced 2024-06-11 01:36:03 +02:00

- 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().
This commit is contained in:
Wayne Davison 2004-10-01 19:48:53 +00:00
parent 2e4db343c6
commit 89eb92d8c2

View File

@ -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;