Skip to content
Merged
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
8 changes: 1 addition & 7 deletions interp/allowed_paths.go
Original file line number Diff line number Diff line change
Expand Up @@ -129,13 +129,7 @@ func (s *pathSandbox) readDir(ctx context.Context, path string) ([]fs.DirEntry,
// os.Root's ReadDir does not guarantee sorted order like os.ReadDir.
// Sort to match POSIX glob expansion expectations.
slices.SortFunc(entries, func(a, b fs.DirEntry) int {
if a.Name() < b.Name() {
return -1
}
if a.Name() > b.Name() {
return 1
}
return 0
return strings.Compare(a.Name(), b.Name())
})
return entries, nil
}
Expand Down
Loading