ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Diane Holt <>
Subject Re: [PATCH] has wrong behaviour against suffix removal
Date Thu, 27 Jun 2002 16:49:28 GMT
--- Loc_Pron <> wrote:
> I just saw has wrong behaviour against suffix removal
> which I corrected:
> -            int pos = value.indexOf('.');
> +            int pos = value.lastIndexOf(suffix);
> At first, as it is removing a _suffix_, it must use lastIndexOf()
> instead of indexOf(): there would have been problems with file.tar.gz
> for example.

Quite right -- just didn't know about lastIndexOf() back then. I'll fix

> Then, as the complete suffix is supplied, this suffix should be
> removed instead of relying on a '.' suffix separator.

Well, the idea was (and the doc states) that you don't need to specify the
".", since from my perspective, that's what defines a suffix. But I
suppose if people wanted to specify a "suffix" that was, say, _suffix
instead of .suffix, then yeah, it'd need to get the last index of "suffix"
instead of ".". It'd mean people would have to include the "." in the
'suffix' attribute, though, and that would break it for anyone already
relying on it being added for them. I suppose I could add a new attribute
(eg., 'delimiter') that defaults to ".".



Do You Yahoo!?
Yahoo! - Official partner of 2002 FIFA World Cup

To unsubscribe, e-mail:   <>
For additional commands, e-mail: <>

View raw message