This handles comments without a trailing space after the comment character. Reported-By: josef64
Move list of directories to a local variable and create the fn variable to use for an individual file name rather than using path.