Fix bug created by fix for files with dots in name

Hi, simple fix here for latest PR 23168869eeb0d58e020f70018b6b8526d6605015

I looked into git history and this seems to me like the proper way to fix the bug created.