ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Eric Fesler" <>
Subject extra CRLF when copying file with filtering
Date Thu, 28 Nov 2002 13:47:37 GMT

Using ant 1.5, I just discover that ant is systematically adding an
extra CRLF at the end of the file when I used that copy task with
filtering set to true.

I've looked in the source and indeed, when the filters are applied, ant
is adding a new line at the end of each line.

In my case, this is an issue because the copied file is used as a
template for an email subject. The extra CRLF makes that the email
message header has an extra blank line and therefore is nomore compliant
with the email RFC.

Does anybody have an idea how to bypass this extra CRLF?

BTW, here is the code as I would correct it.

if (filterChainsAvailable) {
	ChainReaderHelper crh = new ChainReaderHelper();
	Reader rdr = crh.getAssembledReader();
	in = new BufferedReader(rdr);
int length;
String newline = null;
String line = in.readLine();
while (line != null) {
	if (line.length() == 0) {
	} else {
		if (filterSetsAvailable) {
			newline = filters.replaceTokens(line);
		} else {
			newline = line;
		// out.newLine();           // do not add it
	line = in.readLine();
	if (line != null) out.newLine();  // Add the new line only id
really needed


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

View raw message