guile-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH 5/5] [mingw]: Use $LOCALAPPDATA as a possible root for cachedir.


From: Jan Nieuwenhuizen
Subject: [PATCH 5/5] [mingw]: Use $LOCALAPPDATA as a possible root for cachedir.
Date: Tue, 15 Feb 2011 16:35:03 +0100

From: Jan Nieuwenhuizen <address@hidden>

2011-02-15  Jan Nieuwenhuizen  <address@hidden>

        * libguile/load.c (scm_init_load_path) [MINGW32]: Use $LOCALAPPDATA
        to avoid having a NULL cachedir, while still allowing override by
        using $XDG_CACHE_HOME.
---
 libguile/load.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/libguile/load.c b/libguile/load.c
index c2380b9..48a28fe 100644
--- a/libguile/load.c
+++ b/libguile/load.c
@@ -283,6 +283,10 @@ scm_init_load_path ()
 
     if ((e = getenv ("XDG_CACHE_HOME")))
       snprintf (cachedir, sizeof(cachedir), "%s/" FALLBACK_DIR, e);
+#ifdef __MINGW32__
+    else if ((e = getenv ("LOCALAPPDATA")))
+      snprintf (cachedir, sizeof (cachedir), "%s/.cache/" FALLBACK_DIR, e);
+#endif /* __MINGW32__ */
     else if ((e = getenv ("HOME")))
       snprintf (cachedir, sizeof(cachedir), "%s/.cache/" FALLBACK_DIR, e);
 #ifdef HAVE_GETPWENT
-- 
1.7.1

-- 
Jan Nieuwenhuizen <address@hidden> | GNU LilyPond http://lilypond.org
Freelance IT http://JoyofSource.com | Avatar®  http://AvatarAcademy.nl  



reply via email to

[Prev in Thread] Current Thread [Next in Thread]