>From d5e70ba5716dd5b807f7550f9924711365116a8b Mon Sep 17 00:00:00 2001 From: Bernhard R. Link Date: Wed, 29 Apr 2009 11:35:52 +0200 Subject: [PATCH] Fix issues when historysize is zero. If historysize is 0, do not create .ratpoison_history at exit and do keep no entries in history. (Previously ratpoison would always at least store the last entry). --- src/history.c | 6 ++++++ 1 files changed, 6 insertions(+), 0 deletions(-) diff --git a/src/history.c b/src/history.c index b0e66fd..bea9fb6 100644 --- a/src/history.c +++ b/src/history.c @@ -151,6 +151,9 @@ history_add_upto (int history_id, const char *item, size_t max) h->count--; } + if( max == 0 ) + return; + item_len = strlen(item); i = xmalloc (sizeof(struct history_item) + item_len + 1); @@ -217,6 +220,9 @@ history_save (void) FILE *f; struct history_item *item; + if (!defaults.history_size) + return; + if (!filename) return; f = fopen (filename, "w"); -- 1.5.6.5