diff options
author | delphij <delphij@FreeBSD.org> | 2007-06-21 10:42:55 +0000 |
---|---|---|
committer | delphij <delphij@FreeBSD.org> | 2007-06-21 10:42:55 +0000 |
commit | bb6dbdf2f382ed564a935433f1553a0c588e0f5f (patch) | |
tree | 9b5ee02031fe0fca0fb931dda88350d289afe238 /contrib/less/cmdbuf.c | |
parent | 7672cb6e48e2ed472cbd72caaa0eb155608a644d (diff) | |
download | FreeBSD-src-bb6dbdf2f382ed564a935433f1553a0c588e0f5f.zip FreeBSD-src-bb6dbdf2f382ed564a935433f1553a0c588e0f5f.tar.gz |
Virgin import of less v406.
Approved by: re (hrs)
Diffstat (limited to 'contrib/less/cmdbuf.c')
-rw-r--r-- | contrib/less/cmdbuf.c | 16 |
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); |