summaryrefslogtreecommitdiff
path: root/packages/classpath/files/gjar-prefix-patch.diff
blob: 64b262cb41f2990fd484ccd3dc618d2e6d925361 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
Index: tools/gnu/classpath/tools/jar/Entry.java
===================================================================
RCS file: /sources/classpath/classpath/tools/gnu/classpath/tools/jar/Entry.java,v
retrieving revision 1.1
diff -u -r1.1 Entry.java
--- tools/gnu/classpath/tools/jar/Entry.java	8 May 2006 18:38:20 -0000	1.1
+++ tools/gnu/classpath/tools/jar/Entry.java	10 Dec 2007 22:20:05 -0000
@@ -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 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());
   }
+
 }