Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion internal/paths/real.go
Original file line number Diff line number Diff line change
Expand Up @@ -194,4 +194,6 @@ var shortNameForm = regexp.MustCompile(`~[0-9]+(\.[^.]*)?$`)
// short name, which may stand for a folder of another name. Other names
// with a "~" are fine: a real short name elsewhere is caught on disk by
// CheckSyncable.
func LooksShort(name string) bool { return shortNameForm.MatchString(name) }
func LooksShort(name string) bool {
return shortNameForm.MatchString(strings.TrimRight(name, ". "))
}
2 changes: 1 addition & 1 deletion internal/paths/real_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ func TestResolveShortNameForm(t *testing.T) {
t.Errorf("Resolve(home, %q) refused", rel)
}
}
for _, rel := range []string{"PROGRA~1", "MICROS~1.TXT", "Games/SAVEGA~12", "a~1."} {
for _, rel := range []string{"PROGRA~1", "MICROS~1.TXT", "Games/SAVEGA~12", "a~1.", "PROGRA~1 ", "PROGRA~1..", "MICROS~1.TXT."} {
if p, ok := Resolve(Home, rel); ok {
t.Errorf("Resolve(home, %q) = %q, want refused", rel, p)
}
Expand Down