My fault, we discussed this on cygwin-apps when you where adding package support to cygcheck.
I was looking for a clear and easy to read solution ;}. I don't think that supporting foo.tar.bz2.tar.bz2 needs to be an objective though :}. Rob === ----- Original Message ----- From: "Christopher Faylor" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Saturday, January 26, 2002 4:24 AM Subject: 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 >