feature #4977: fix namefile bugs on windows