Merge pull request #1448 from calmh/xp

Fall back to %AppData% is %LocalAppData% is blank (fixes #1446)
This commit is contained in:
Audrius Butkevicius 2015-03-11 20:06:13 +00:00
commit 5253368acc

View File

@ -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")