From 2ba4b235fc091ed0e918e0f7edbbee504ee4b1d3 Mon Sep 17 00:00:00 2001 From: Jakob Borg Date: Tue, 28 Oct 2014 20:52:28 +0100 Subject: [PATCH] Windows logfile should follow -home by default (fixes #918) --- cmd/syncthing/main.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/cmd/syncthing/main.go b/cmd/syncthing/main.go index ad0f0ef58..0abc75742 100644 --- a/cmd/syncthing/main.go +++ b/cmd/syncthing/main.go @@ -234,6 +234,13 @@ func main() { confDir = defConfDir } + if confDir != defConfDir && filepath.Dir(logFile) == defConfDir { + // The user changed the config dir with -home, but not the log file + // location. In this case we assume they meant for the logfile to + // still live in it's default location *relative to the config dir*. + logFile = filepath.Join(confDir, "syncthing.log") + } + if showVersion { fmt.Println(LongVersion) return