ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Peter Donald <pe...@apache.org>
Subject GNU Tar terminated with null?
Date Thu, 21 Mar 2002 14:58:12 GMT
Hi,

I just came across what I think is a bug in the tar utility classes. In 
method putNextEntry at about line 170 there is the following

// create a TarEntry for the LongLink, the contents
// of which are the entry's name 
TarEntry longLinkEntry = new TarEntry(TarConstants.GNU_LONGLINK,
                                  TarConstants.LF_GNUTYPE_LONGNAME);
                 
longLinkEntry.setSize(entry.getName().length() + 1);
putNextEntry(longLinkEntry);                                  
                  
write(entry.getName().getBytes());
write(0);
closeEntry();

Notice that it terminates the string with a NULL/0 - is this an error. It 
looks like it is an error???? Shouldn't we nuke the +1 and write(0) ?

-- 
Cheers,

Pete

----------------------------------
Ancient Go proverb: "Only amateurs 
try to come up with 'fancy' moves"
----------------------------------

--
To unsubscribe, e-mail:   <mailto:ant-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:ant-dev-help@jakarta.apache.org>


Mime
View raw message