a filename without extension should also be processed through tools::file_ext()

otherwise, e.g., Makefile returns Makefile, and the 'empty' argument will not really be used