lib/model: Invalidate files with trailing white space on Windows (fixes #3227)

GitHub-Pull-Request: https://github.com/syncthing/syncthing/pull/3383
This commit is contained in:
Jakob Borg
2016-07-04 10:44:30 +00:00
committed by Audrius Butkevicius
parent fa0101bd60
commit aa50ef4069
2 changed files with 28 additions and 1 deletions

View File

@@ -41,7 +41,7 @@ func (m nativeModel) Request(deviceID DeviceID, folder string, name string, offs
func fixupFiles(folder string, files []FileInfo) {
for i, f := range files {
if strings.ContainsAny(f.Name, disallowedCharacters) {
if strings.ContainsAny(f.Name, disallowedCharacters) || strings.HasSuffix(f.Name, " ") {
if f.IsDeleted() {
// Don't complain if the file is marked as deleted, since it
// can't possibly exist here anyway.