ASF Bugzilla – Attachment 16547 Details for
Bug 36851
<tar> Task does not support multi-byte file names
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Tweaks illustrating a couple of the problem areas
problem-areas.patch (text/plain), 1.41 KB, created by
Daniel Rall
on 2005-09-29 01:06:58 UTC
(
hide
)
Description:
Tweaks illustrating a couple of the problem areas
Filename:
MIME Type:
Creator:
Daniel Rall
Created:
2005-09-29 01:06:58 UTC
Size:
1.41 KB
patch
obsolete
>Index: src/main/org/apache/tools/tar/TarOutputStream.java >=================================================================== >--- src/main/org/apache/tools/tar/TarOutputStream.java (revision 292297) >+++ src/main/org/apache/tools/tar/TarOutputStream.java (working copy) >@@ -169,7 +169,7 @@ > TarEntry longLinkEntry = new TarEntry(TarConstants.GNU_LONGLINK, > TarConstants.LF_GNUTYPE_LONGNAME); > >- longLinkEntry.setSize(entry.getName().length() + 1); >+ longLinkEntry.setSize(entry.getName().getBytes().length + 1); > putNextEntry(longLinkEntry); > write(entry.getName().getBytes()); > write(0); >Index: src/main/org/apache/tools/tar/TarUtils.java >=================================================================== >--- src/main/org/apache/tools/tar/TarUtils.java (revision 292297) >+++ src/main/org/apache/tools/tar/TarUtils.java (working copy) >@@ -99,8 +99,9 @@ > public static int getNameBytes(StringBuffer name, byte[] buf, int offset, int length) { > int i; > >- for (i = 0; i < length && i < name.length(); ++i) { >- buf[offset + i] = (byte) name.charAt(i); >+ byte[] nameData = name.toString().getBytes(); >+ for (i = 0; i < length && i < nameData.length; ++i) { >+ buf[offset + i] = (byte) nameData[i]; > } > > for (; i < length; ++i) {
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 36851
: 16547