From 651d4a0781cbbc44c9eafb2dd59791db5695223f Mon Sep 17 00:00:00 2001
From: Arun Isaac
Date: Wed, 10 Nov 2021 22:39:11 +0530
Subject: utils: compat: Set fallback for *skribe-rc-directory*.

* src/guile/skribilo/utils/compat.scm (*skribe-rc-directory*): Set
fallback value in case the HOME environment variable is not set.
---
 src/guile/skribilo/utils/compat.scm | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

(limited to 'src')

diff --git a/src/guile/skribilo/utils/compat.scm b/src/guile/skribilo/utils/compat.scm
index 81f2570..7c00efb 100644
--- a/src/guile/skribilo/utils/compat.scm
+++ b/src/guile/skribilo/utils/compat.scm
@@ -2,6 +2,7 @@
 ;;; -*- coding: iso-8859-1 -*-
 ;;;
 ;;; Copyright 2005, 2006, 2007, 2009  Ludovic Court�s  <ludo@gnu.org>
+;;; Copyright 2021 Arun Isaac <arunisaac@systemreboot.net>
 ;;;
 ;;;
 ;;; This file is part of Skribilo.
@@ -105,7 +106,9 @@
 
 
 (define-public *skribe-rc-directory*
-  (string-append (getenv "HOME") "/" ".skribilo"))
+  (let ((home (or (getenv "HOME")
+                  (passwd:dir (getpwuid (getuid))))))
+    (string-append home "/" ".skribilo")))
 
 
 ;;; In and out ports
-- 
cgit v1.2.3