FELIX-400: apply Carlos' patch to fix array out of bounds exception when the resource directory is the same as the basedir

git-svn-id: https://svn.apache.org/repos/asf/felix/trunk@586243 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/bundleplugin/src/main/java/org/apache/felix/bundleplugin/BundlePlugin.java b/bundleplugin/src/main/java/org/apache/felix/bundleplugin/BundlePlugin.java
index 56f4a29..b2f7d35 100644
--- a/bundleplugin/src/main/java/org/apache/felix/bundleplugin/BundlePlugin.java
+++ b/bundleplugin/src/main/java/org/apache/felix/bundleplugin/BundlePlugin.java
@@ -595,7 +595,14 @@
                 // make relative to basedir
                 if (path.startsWith(basePath))
                 {
-                    path = path.substring(basePath.length() + 1);
+                    if ( path.length() == basePath.length() )
+                    {
+                        path = ".";
+                    }
+                    else
+                    {
+                        path = path.substring( basePath.length() + 1 );
+                    }
                 }
                 // replace windows backslash with a slash
                 // this is a workaround for a problem with bnd 0.0.189