summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorBernhard R. Link <brlink@debian.org>2009-04-29 11:35:52 +0200
committerBernhard R. Link <brlink@debian.org>2009-04-29 11:39:13 +0200
commitd5e70ba5716dd5b807f7550f9924711365116a8b (patch)
tree3fdb381426d1476cbc033fb7f114b4c9689d5696 /src
parentac37eba33a3f4acf623f403f826347dde13a6213 (diff)
downloadratpoison-d5e70ba5716dd5b807f7550f9924711365116a8b.zip
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).
Diffstat (limited to 'src')
-rw-r--r--src/history.c6
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");