separate prefix from namePattern
fix https://github.com/chrislusf/seaweedfs/issues/1722
This commit is contained in:
@@ -19,12 +19,16 @@ func splitPattern(pattern string) (prefix string, restPattern string) {
|
||||
return "", restPattern
|
||||
}
|
||||
|
||||
func (f *Filer) ListDirectoryEntries(ctx context.Context, p util.FullPath, startFileName string, inclusive bool, limit int, namePattern string) (entries []*Entry, err error) {
|
||||
// For now, prefix and namePattern are mutually exclusive
|
||||
func (f *Filer) ListDirectoryEntries(ctx context.Context, p util.FullPath, startFileName string, inclusive bool, limit int, prefix string, namePattern string) (entries []*Entry, err error) {
|
||||
if strings.HasSuffix(string(p), "/") && len(p) > 1 {
|
||||
p = p[0 : len(p)-1]
|
||||
}
|
||||
|
||||
prefix, restNamePattern := splitPattern(namePattern)
|
||||
prefixInNamePattern, restNamePattern := splitPattern(namePattern)
|
||||
if prefixInNamePattern != "" {
|
||||
prefix = prefixInNamePattern
|
||||
}
|
||||
var missedCount int
|
||||
var lastFileName string
|
||||
|
||||
|
||||
Reference in New Issue
Block a user