From 51cfc3d4beb21b5db13a49428a975916545cddc3 Mon Sep 17 00:00:00 2001 From: Jakob Borg Date: Wed, 11 Mar 2015 21:03:42 +0100 Subject: [PATCH] Fall back to %AppData% is %LocalAppData% is blank (fixes #1446) --- cmd/syncthing/main.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/cmd/syncthing/main.go b/cmd/syncthing/main.go index b046c664a..278fcaacd 100644 --- a/cmd/syncthing/main.go +++ b/cmd/syncthing/main.go @@ -948,7 +948,10 @@ func ensureDir(dir string, mode int) { func getDefaultConfDir() (string, error) { switch runtime.GOOS { case "windows": - return filepath.Join(os.Getenv("LocalAppData"), "Syncthing"), nil + if p := os.Getenv("LocalAppData"); p != "" { + return filepath.Join(p, "Syncthing"), nil + } + return filepath.Join(os.Getenv("AppData"), "Syncthing"), nil case "darwin": return osutil.ExpandTilde("~/Library/Application Support/Syncthing")