summary refs log tree commit diff
path: root/bin
diff options
context:
space:
mode:
authorJune McEnroe <june@causal.agency>2019-04-18 22:01:42 -0400
committerJune McEnroe <june@causal.agency>2019-04-18 22:01:42 -0400
commite930ec711fbb7029447efb960de2aa721fd9d51a (patch)
treea83a5c86ddb988a955cb815e3ba8401956c3f094 /bin
parentClean up catsh config (diff)
downloadsrc-e930ec711fbb7029447efb960de2aa721fd9d51a.tar.gz
src-e930ec711fbb7029447efb960de2aa721fd9d51a.zip
Factor out XDG_CONFIG_HOME and XDG_DATA_HOME
Diffstat (limited to '')
-rw-r--r--bin/catsh/var.c17
1 files changed, 7 insertions, 10 deletions
diff --git a/bin/catsh/var.c b/bin/catsh/var.c
index 4e486e64..f11ff8b7 100644
--- a/bin/catsh/var.c
+++ b/bin/catsh/var.c
@@ -107,18 +107,15 @@ struct var vdisvfork;
 struct localvar *localvars;
 int forcelocal;
 
+#define XDG_CONFIG_HOME "${XDG_CONFIG_HOME:-${HOME}/.config}"
+#define XDG_DATA_HOME "${XDG_DATA_HOME:-${HOME}/.local/share}"
+
 static const struct varinit varinit[] = {
-	{
-		&venv, 0,
-		"ENV=${XDG_CONFIG_HOME:-${HOME}/.config}/catsh/env.sh",
-		NULL,
-	},
+	{ &venv, 0, "ENV=" XDG_CONFIG_HOME "/catsh/env.sh",
+	  NULL },
 #ifndef NO_HISTORY
-	{
-		&vhistfile, 0,
-		"HISTFILE=${XDG_DATA_HOME:-${HOME}/.local/share}/catsh/history",
-		sethistfile,
-	},
+	{ &vhistfile, 0, "HISTFILE=" XDG_DATA_HOME "/catsh/history",
+	  sethistfile },
 	{ &vhistsize,	VUNSET,				"HISTSIZE=",
 	  sethistsize },
 #endif
ef='/zlib-man-pages/commit/gzsetparams.3?id=629024bec1c56ec7afb4fe40621ce2a772122f6e&follow=1'>Add gzsetparams.3June McEnroe 2018-11-12Add gzbuffer.3June McEnroe 2018-11-12Add gzdopen to gzopen.3June McEnroe 2018-11-12Add gzopen.3June McEnroe 2018-11-12Add inflateBackEnd.3June McEnroe 2018-11-12Add inflateBack.3June McEnroe 2018-11-12Add inflateBackInit.3June McEnroe 2018-11-11Add inflateGetHeader.3June McEnroe 2018-11-11Add inflateMark.3June McEnroe 2018-11-11Add inflatePrime.3June McEnroe 2018-11-11Add inflateReset.3June McEnroe 2018-11-11Add inflateCopy.3June McEnroe 2018-11-11Add inflateSync.3June McEnroe 2018-11-11Add inflateGetDictionary.3June McEnroe 2018-11-11Add inflateSetDictionary.3June McEnroe 2018-11-11Add inflateInit2.3June McEnroe