This is the mail archive of the cygwin-patches@cygwin.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH]Package extention recognition (revision 2)


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.

cgf


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]