Skip to content

Commit

Permalink
downloader: using QuoteMeta wraps the filename
Browse files Browse the repository at this point in the history
  • Loading branch information
iawia002 committed May 10, 2020
1 parent 424f8de commit 6fee247
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion downloader/downloader.go
Original file line number Diff line number Diff line change
Expand Up @@ -404,7 +404,7 @@ func readDirAllFilePart(filePath, filename, extname string) ([]*FilePartMeta, er
return nil, err
}
var metas []*FilePartMeta
reg := regexp.MustCompile(fmt.Sprintf("%s.%s.part.+", filename, extname))
reg := regexp.MustCompile(fmt.Sprintf("%s.%s.part.+", regexp.QuoteMeta(filename), extname))
for _, fn := range fns {
if reg.MatchString(fn.Name()) {
meta, err := parseFilePartMeta(path.Join(dirPath, fn.Name()), fn.Size())
Expand Down

0 comments on commit 6fee247

Please sign in to comment.