Check for filename length instead of truthiness.

Otherwise, if a directory contains a file named '0', we assume no more
files exist (while there could still be any number left)
Merge pull request #268 from retupmoca/nom

Check for filename length instead of truthiness.