This is the mail archive of the 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 10:06:30AM -0800, Michael A Chase wrote:
>----- Original Message -----
>From: "Christopher Faylor" <>
>To: <>
>Sent: Friday, January 25, 2002 09:24
>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.
>Is the "improved" version my change or the way I found it?

The current version, prior to your change has been "improved".

>>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.
>I can go either way.  It is hard for me to imagine
>foo-0.0.tar.bz2.tar.gz being valid, but my patched version would accept
>it while the original version would reject it.

Ok.  I didn't look closely at your patch.  My version would accept the
above, too.

>Neither version is fool proof for some values of fool; both would pass
>foo-0.0.tar.gz.tar.bz2.  If you like I can move the '(end - ext) == x'
>test back to the 'return' statement.

I guess that's up to Robert.  The ChangeLog indicates that he made this


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