summaryrefslogtreecommitdiff
path: root/src/history.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/history.c')
-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");