ppp
ppp copied to clipboard
Exit early if we strlen on an empty string
In the event we do strlen on an empty string, we should bail.
In the context of the existing code, the change proposed is reasonable, but the commit message is not illuminating, because it doesn't explain the connection between an empty string and bailing out. The mention of strlen doesn't help - doing strlen on an empty string is fine.
I think the existing code is actually buggy and has been buggy since it was first written, in that it treats all allowed number strings as wildcards, whether there is a '*' on the end or not. I don't think that was really the original intention. That means that an empty string is equivalent to "*", and that is why bailing out on an empty string is correct (in terms of fixing the code without changing its behaviour).
@AtariDreams: Have you seen the @paulusmack answer?
never mind... I pushed a change to make it handle non-wildcards correctly, which also solves the issue this PR was addressing.