1
0
mirror of https://github.com/gilbertchen/duplicacy synced 2025-12-06 00:03:38 +00:00

Trim the preference path in case any space/newlines are accidentally added

This commit is contained in:
Gilbert Chen
2017-09-16 21:21:26 -04:00
parent 6bffef36bf
commit 3cf3ad06fa

View File

@@ -5,6 +5,7 @@
package duplicacy
import (
"strings"
"encoding/json"
"path"
"io/ioutil"
@@ -43,7 +44,7 @@ func LoadPreferences(repository string) bool {
LOG_ERROR("DOT_DUPLICACY_PATH", "Failed to locate the preference path: %v", err)
return false
}
realPreferencePath := string(content)
realPreferencePath := strings.TrimSpace(string(content))
stat, err := os.Stat(realPreferencePath)
if err != nil {
LOG_ERROR("PREFERENCE_PATH", "Failed to retrieve the information about the directory %s: %v", content, err)