This is the mail archive of the
java-patches@gcc.gnu.org
mailing list for the Java project.
FYI: Patch: java.io.FilePermission
- From: Michael Koch <konqueror at gmx dot de>
- To: java-patches at gcc dot gnu dot org
- Date: Fri, 19 Mar 2004 23:06:30 +0100
- Subject: FYI: Patch: java.io.FilePermission
Hi list,
I just commited the attached patch which fixes an off-by-one error.
Michael
2004-03-19 Mark Wielaard <mark@klomp.org>
Reported by Stephen Crawley
* java/io/FilePermission.java (implies): Use String.length() -1 to
access last char of String.
Index: java/io/FilePermission.java
===================================================================
RCS file: /cvs/gcc/gcc/libjava/java/io/FilePermission.java,v
retrieving revision 1.9
diff -u -b -B -r1.9 FilePermission.java
--- java/io/FilePermission.java 4 Dec 2003 20:09:57 -0000 1.9
+++ java/io/FilePermission.java 19 Mar 2004 22:01:24 -0000
@@ -271,9 +271,9 @@
break;
*/
default:
- if(f2.charAt(f2.length()) == File.separatorChar)
+ if(f2.charAt(f2.length() - 1) == File.separatorChar)
{
- if(!f1.equals(f2.substring(0,f2.length()-1)))
+ if(!f1.equals(f2.substring(0,f2.length() - 1)))
return false;
}
else