Author: markt
Date: Fri Sep 22 21:28:47 2017
New Revision: 1809358

URL: http://svn.apache.org/viewvc?rev=1809358&view=rev
Log:
Fix broken tests caused by "" vs "/" when resource is at base of DirContext

Modified:
    tomcat/tc7.0.x/trunk/java/org/apache/naming/resources/FileDirContext.java

Modified: 
tomcat/tc7.0.x/trunk/java/org/apache/naming/resources/FileDirContext.java
URL: 
http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/java/org/apache/naming/resources/FileDirContext.java?rev=1809358&r1=1809357&r2=1809358&view=diff
==============================================================================
--- tomcat/tc7.0.x/trunk/java/org/apache/naming/resources/FileDirContext.java 
(original)
+++ tomcat/tc7.0.x/trunk/java/org/apache/naming/resources/FileDirContext.java 
Fri Sep 22 21:28:47 2017
@@ -870,8 +870,9 @@ public class FileDirContext extends Base
         //
         // absPath is normalized so canPath needs to be normalized as well
         // Can't normalize canPath earlier as canonicalBase is not normalized
-        if (canPath.length() > 0) {
-            canPath = normalize(canPath);
+        canPath = normalize(canPath);
+        if (absPath.length() == 0) {
+            absPath = "/";
         }
         if (!canPath.equals(absPath)) {
             return null;



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org

Reply via email to