summary refs log tree commit diff
path: root/bin/catsh/var.c
diff options
context:
space:
mode:
Diffstat (limited to 'bin/catsh/var.c')
-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