From 6afce8909c4c8e04169364b92742d9ccc202410d Mon Sep 17 00:00:00 2001 From: Tom Tromey Date: Thu, 17 Apr 2008 17:16:09 +0000 Subject: [PATCH] re PR libgcj/35950 (jar produces files ecj won't handle) PR libgcj/35950: * tools/gnu/classpath/tools/jar/Entry.java: New version from Classpath. * tools/classes/gnu/classpath/tools/jar/Entry.class: Update. From-SVN: r134402 --- libjava/classpath/ChangeLog.gcj | 7 +++++++ .../gnu/classpath/tools/jar/Entry.class | Bin 634 -> 873 bytes .../tools/gnu/classpath/tools/jar/Entry.java | 18 ++++++++++++++---- 3 files changed, 21 insertions(+), 4 deletions(-) diff --git a/libjava/classpath/ChangeLog.gcj b/libjava/classpath/ChangeLog.gcj index ffc357133b67..093b2fbe0e47 100644 --- a/libjava/classpath/ChangeLog.gcj +++ b/libjava/classpath/ChangeLog.gcj @@ -1,3 +1,10 @@ +2008-04-17 Tom Tromey + + PR libgcj/35950: + * tools/gnu/classpath/tools/jar/Entry.java: New version from + Classpath. + * tools/classes/gnu/classpath/tools/jar/Entry.class: Update. + 2008-03-02 Jakub Jelinek * gnu/java/rmi/registry/RegistryImpl.java (version): Update diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/jar/Entry.class b/libjava/classpath/tools/classes/gnu/classpath/tools/jar/Entry.class index d030d92ddd800119199eb9434c6d6eb4b03534c1..b517df7439dcb49b68354ce5b327d10f063fc7cc 100644 GIT binary patch delta 505 zc-mc%!A=uV6o$XkPFs3AYEdZ&R0T!bX{EF%5g{0@F=@gA-IJ9uMae&Bj)Dz*NMWJabb*(^}*zmi#Fl(cA*#Pofsc7GDZ()X@9JJ?QP zn=8?^AH=^zBgFxu+1TcHCX3ktEW=Q}J)6z8?K`hW9hu%>B~+2=}!*nDFl` z7S-V~DVDj+Dx=z`c)}bjR9Mscl-!WtJuxS*tAr>h+3b9hH delta 281 zc-ni(_KSt<)W2Q(7#J7~85AaR?PcX;U}O-QT)`NwC#d0*l~|UjpP8@kmYI`ktr^C} zAju%j&LG9ez=JHq!yv;TJNY}K(qv^O=lVznCI)7pdHh=28F;j`w*nbDTNwm50)?0u zgn^_G0}I$X76xMmP6iVOJ_b_;5uk_yL>q%BgBSw?n8nJ#26PRG#m>M1)XfM~FAgNR yfnq^GJ`>0^gf-gR7$mm3Vp?SmBrSnjtr!Futie`^LA1iH5`tRA$RG#SD-Qq}EF;JO diff --git a/libjava/classpath/tools/gnu/classpath/tools/jar/Entry.java b/libjava/classpath/tools/gnu/classpath/tools/jar/Entry.java index aa8679aab55c..b9108798a16f 100644 --- a/libjava/classpath/tools/gnu/classpath/tools/jar/Entry.java +++ b/libjava/classpath/tools/gnu/classpath/tools/jar/Entry.java @@ -1,5 +1,5 @@ /* Entry.java - represent a single file to write to a jar - Copyright (C) 2006 Free Software Foundation, Inc. + Copyright (C) 2006, 2007 Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -49,12 +49,22 @@ public class Entry public Entry(File file, String name) { this.file = file; - this.name = name; + + /* Removes any './' prefixes automatically. Those caused trouble + * in (boot) classpath use-cases. See #32516. + */ + int start = 0; + while (name.length() > start + 2 + && name.codePointAt(start) == '.' + && name.codePointAt(start + 1) == File.separatorChar) + start += 2; + + this.name = name.substring(start); } public Entry(File file) { - this.file = file; - this.name = file.toString(); + this(file, file.toString()); } + } -- 2.47.3