diff options
author | Jan Nieuwenhuizen <janneke@gnu.org> | 2011-02-15 16:35:03 +0100 |
---|---|---|
committer | Andy Wingo <wingo@pobox.com> | 2011-06-17 00:01:39 +0200 |
commit | 284019a2a5cfd7c7734701671f6a1776f11211eb (patch) | |
tree | 0881cde9eb217cfb9f874e74882f76442ff1cdb6 /libguile/load.c | |
parent | a67f2fce5456caf8e63dacb110b8e15600bb1c9f (diff) |
mingw: use $APPDATA as a possible root for cachedir.
* libguile/load.c (scm_init_load_path) [MINGW32]: Fall back to using
$LOCALAPPDATA or $APPDATA if $XDG_CACHE_HOME and $HOME aren't set.
Diffstat (limited to 'libguile/load.c')
-rw-r--r-- | libguile/load.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/libguile/load.c b/libguile/load.c index fa19a2a66..8cc08e89b 100644 --- a/libguile/load.c +++ b/libguile/load.c @@ -293,6 +293,12 @@ scm_init_load_path () snprintf (cachedir, sizeof(cachedir), "%s/.cache/" FALLBACK_DIR, pwd->pw_dir); #endif /* HAVE_GETPWENT */ +#ifdef __MINGW32__ + else if ((e = getenv ("LOCALAPPDATA"))) + snprintf (cachedir, sizeof (cachedir), "%s/.cache/" FALLBACK_DIR, e); + else if ((e = getenv ("APPDATA"))) + snprintf (cachedir, sizeof (cachedir), "%s/.cache/" FALLBACK_DIR, e); +#endif /* __MINGW32__ */ else cachedir[0] = 0; |