PerlAlien / File-Listing

Module to parse directoy listings
1 stars 3 forks source link

File::Listing, sub "parse_dir": Fails if file/directory name starts with space-char [rt.cpan.org #47997] #6

Open plicease opened 4 years ago

plicease commented 4 years ago

https://rt.cpan.org/Ticket/Display.html?id=47997

Library:  File::Listing
Sub:  parse_dir

The sub "parse_dir" doesn't parse names of files/directories correctly 
if they start with one or more space-chars. Using spaces at position 0 
is again some genius idea of a generic computer user, but it's still a 
bug in the parsing routine. :)
Cause the occurrence of this situation is rare I think, this bug isn't 
that important.

Original post of bug in perl-application "FTPSync":
https://sourceforge.net/tracker/?
func=detail&aid=797178&group_id=38241&atid=421898
plicease commented 4 years ago

I think this could be a tricky thing to fix, as there isn't an easy way to differentiate between output padding and a filename with leading space. I think trailing space could be a problem as well. I am happy to review PRs to try to address this though.