Description: Fixup handling of JNDI name parsing.
Origin: http://svn.apache.org/viewvc?diff_format=h&view=revision&revision=1304471

Index: tomcat7/java/org/apache/naming/SelectorContext.java
===================================================================
--- tomcat7.orig/java/org/apache/naming/SelectorContext.java	2012-07-12 21:44:06.000000000 +0100
+++ tomcat7/java/org/apache/naming/SelectorContext.java	2012-07-12 21:50:41.895575594 +0100
@@ -766,9 +766,15 @@
     protected Name parseName(Name name) 
         throws NamingException {
 
-        if ((!initialContext) && (!name.isEmpty()) 
-            && (name.get(0).equals(prefix))) {
-            return (name.getSuffix(1));
+        if (!initialContext && !name.isEmpty() &&
+                name.get(0).startsWith(prefix)) {
+            if (name.get(0).equals(prefix)) {
+                return name.getSuffix(1);
+            } else {
+                Name result = name.getSuffix(1);
+                result.add(0, name.get(0).substring(prefixLength));
+                return result;
+            }
         } else {
             if (initialContext) {
                 return (name);
