support spaces in filenames
PR: 275978 MFC after: 1 week
(cherry picked from commit 789480702e490818244af11279868ba4f3dabe6b)