summaryrefslogtreecommitdiffstats
path: root/contrib/less/cmdbuf.c
diff options
context:
space:
mode:
authordelphij <delphij@FreeBSD.org>2007-06-21 10:42:55 +0000
committerdelphij <delphij@FreeBSD.org>2007-06-21 10:42:55 +0000
commit5f3f215c2acdfadb42784e7363ccf777a993ca02 (patch)
treec780c1aea3a3dea2249bcfe0b2071247ed385670 /contrib/less/cmdbuf.c
parentc42a76d47fee6466cac768757f65afe30dd6eb89 (diff)
parentbb6dbdf2f382ed564a935433f1553a0c588e0f5f (diff)
downloadFreeBSD-src-5f3f215c2acdfadb42784e7363ccf777a993ca02.zip
FreeBSD-src-5f3f215c2acdfadb42784e7363ccf777a993ca02.tar.gz
This commit was generated by cvs2svn to compensate for changes in r170964,
which included commits to RCS files with non-trunk default branches.
Diffstat (limited to 'contrib/less/cmdbuf.c')
-rw-r--r--contrib/less/cmdbuf.c16
1 files changed, 13 insertions, 3 deletions
diff --git a/contrib/less/cmdbuf.c b/contrib/less/cmdbuf.c
index 6effb60..ad79ce9 100644
--- a/contrib/less/cmdbuf.c
+++ b/contrib/less/cmdbuf.c
@@ -1390,11 +1390,14 @@ init_cmdhist()
}
if (strcmp(line, HISTFILE_SEARCH_SECTION) == 0)
ml = &mlist_search;
-#if SHELL_ESCAPE || PIPEC
else if (strcmp(line, HISTFILE_SHELL_SECTION) == 0)
+ {
+#if SHELL_ESCAPE || PIPEC
ml = &mlist_shell;
+#else
+ ml = NULL;
#endif
- else if (*line == '"')
+ } else if (*line == '"')
{
if (ml != NULL)
cmd_addhist(ml, line+1);
@@ -1444,11 +1447,18 @@ save_cmdhist()
#if CMD_HISTORY
char *filename;
FILE *f;
+ int modified = 0;
filename = histfile_name();
if (filename == NULL)
return;
- if (!mlist_search.modified && !mlist_shell.modified)
+ if (mlist_search.modified)
+ modified = 1;
+#if SHELL_ESCAPE || PIPEC
+ if (mlist_shell.modified)
+ modified = 1;
+#endif
+ if (!modified)
return;
f = fopen(filename, "w");
free(filename);
OpenPOWER on IntegriCloud