fixup #674 - should test .length instead of .ptr
still print line information when filename is empty
Merge pull request #688 from MartinNowak/fixup674

fixup #674 - should test .length instead of .ptr