Skip to content

Commit

Permalink
taildrop: Allow category Z unicode characters (tailscale#10750)
Browse files Browse the repository at this point in the history
This will expand the unicode character categories that we allow for valid filenames to go from "L, M, N, P, S, and the ASCII space character" to "L, M, N, P, S, Zs"

Fixes tailscale#10105

Signed-off-by: Rhea Ghosh <rhea@tailscale.com>
  • Loading branch information
rhealitycheck committed Jan 5, 2024
1 parent d3574a3 commit dbe7096
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion taildrop/taildrop.go
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ func validFilenameRune(r rune) bool {
// sent.
return false
}
return unicode.IsPrint(r)
return unicode.IsGraphic(r)
}

func isPartialOrDeleted(s string) bool {
Expand Down
1 change: 1 addition & 0 deletions taildrop/taildrop_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ func TestNextFilename(t *testing.T) {
{"my song.mp3", "my song (1).mp3", "my song (2).mp3"},
{"archive.7z", "archive (1).7z", "archive (2).7z"},
{"foo/bar/fizz", "foo/bar/fizz (1)", "foo/bar/fizz (2)"},
{"新完全マスター N2 文法.pdf", "新完全マスター N2 文法 (1).pdf", "新完全マスター N2 文法 (2).pdf"},
}

for _, tt := range tests {
Expand Down

0 comments on commit dbe7096

Please sign in to comment.