[Arakhnę-Dev] [84] Major bug fix: avoid IndexOutOfBoundsException

[ Thread Index | Date Index | More arakhne.org/dev Archives ]


Revision: 84
Author:   galland
Date:     2009-10-23 00:28:16 +0200 (Fri, 23 Oct 2009)
Log Message:
-----------
Major bug fix: avoid IndexOutOfBoundsException

Modified Paths:
--------------
    trunk/arakhneVmutils/java/src/main/java/org/arakhne/vmutil/FileSystem.java

Modified: trunk/arakhneVmutils/java/src/main/java/org/arakhne/vmutil/FileSystem.java
===================================================================
--- trunk/arakhneVmutils/java/src/main/java/org/arakhne/vmutil/FileSystem.java	2009-08-07 10:29:12 UTC (rev 83)
+++ trunk/arakhneVmutils/java/src/main/java/org/arakhne/vmutil/FileSystem.java	2009-10-22 22:28:16 UTC (rev 84)
@@ -239,7 +239,7 @@
 				buf.append(File.separatorChar);
 			}
 			else if (!empty) {
-				if (buf.charAt(buf.length()-1)!=File.separatorChar)
+				if (buf.length()>0 && buf.charAt(buf.length()-1)!=File.separatorChar)
 					buf.append(File.separatorChar);
 				buf.append(elt);
 			}


Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/