use bsd_glob instead to support dirs with spaces
(cherry picked from commit b332d87bf62e50fc576d4ed7420fb9560eb5cfe7)