From 0c407935140531f4c6417faec8e7de3b2cccb619 Mon Sep 17 00:00:00 2001 From: June McEnroe Date: Mon, 21 Jan 2019 17:17:52 -0500 Subject: Save cash history incrementally Still needs better error and edge case handling, but seems to work. --- bin/cash/var.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'bin/cash/var.c') diff --git a/bin/cash/var.c b/bin/cash/var.c index 26c39eb4..70e05385 100644 --- a/bin/cash/var.c +++ b/bin/cash/var.c @@ -108,10 +108,17 @@ struct localvar *localvars; int forcelocal; static const struct varinit varinit[] = { - { &venv, 0, "ENV=${XDG_CONFIG_HOME:-${HOME}/.config}/cash/env.sh", NULL }, + { + &venv, 0, + "ENV=${XDG_CONFIG_HOME:-${HOME}/.config}/cash/env.sh", + NULL, + }, #ifndef NO_HISTORY - { &vhistfile, VUNSET, "HISTFILE=", - sethistfile }, + { + &vhistfile, 0, + "HISTFILE=${XDG_DATA_HOME:-${HOME}/.local/share}/cash/history", + sethistfile, + }, { &vhistsize, VUNSET, "HISTSIZE=", sethistsize }, #endif -- cgit 1.4.1