[PATCH]Package extention recognition (revision 2)
Fri Jan 25 09:24:00 GMT 2002
On Fri, Jan 25, 2002 at 02:59:17AM -0800, Michael A Chase wrote:
>And that test is still there, I moved it into the if () so something like
>".tar.bz2" wouldn't trigger the return .... : 0; If all the ifs fail,
>return 0; still occurs.
Hmm. Seems like someone has "improved" this code from when I wrote it.
My version checked for a trailing component. If it existed, it returned
the index into the string.
This version sort of does the same thing but if there is a .tar.bz2
anywhere in the string prior to trailing component, it will fail
regardless of whether the filename ends with .tar .tar.gz or .tar.bz2.
Perhaps that is an acceptable risk but it puzzles me why anyone would
move from an algorithm that was foolproof to one that wasn't.
More information about the Cygwin-patches