diff options
| author | Xin LI <delphij@FreeBSD.org> | 2007-06-21 10:42:55 +0000 |
|---|---|---|
| committer | Xin LI <delphij@FreeBSD.org> | 2007-06-21 10:42:55 +0000 |
| commit | efd72c2eb66e67c4f367ba48c3effd0ae2a668e1 (patch) | |
| tree | 9b5ee02031fe0fca0fb931dda88350d289afe238 /contrib/less/cmdbuf.c | |
| parent | 7f074f9c8f37a841d4ed3a3947143d83c9972f81 (diff) | |
Notes
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 6effb60aeada..ad79ce9b9096 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); |
