This is an automated email from the ASF dual-hosted git repository.

markt pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/tomcat.git


The following commit(s) were added to refs/heads/main by this push:
     new 5b6258fb09 Move infinite copy test to include all recurrsive code
5b6258fb09 is described below

commit 5b6258fb096c2bd80ca0a944631efc887cb2b2e6
Author: Mark Thomas <ma...@apache.org>
AuthorDate: Thu May 23 13:26:46 2024 +0100

    Move infinite copy test to include all recurrsive code
    
    Review by kkolinko
---
 .../apache/catalina/servlets/WebdavServlet.java    | 26 +++++++++++-----------
 1 file changed, 13 insertions(+), 13 deletions(-)

diff --git a/java/org/apache/catalina/servlets/WebdavServlet.java 
b/java/org/apache/catalina/servlets/WebdavServlet.java
index b1b67030af..121d2d6593 100644
--- a/java/org/apache/catalina/servlets/WebdavServlet.java
+++ b/java/org/apache/catalina/servlets/WebdavServlet.java
@@ -1586,19 +1586,19 @@ public class WebdavServlet extends DefaultServlet 
implements PeriodicEventListen
                 }
             }
 
-            String[] entries = resources.list(source);
-            for (String entry : entries) {
-                String childDest = dest;
-                if (!childDest.equals("/")) {
-                    childDest += "/";
-                }
-                childDest += entry;
-                String childSrc = source;
-                if (!childSrc.equals("/")) {
-                    childSrc += "/";
-                }
-                childSrc += entry;
-                if (infiniteCopy) {
+            if (infiniteCopy) {
+                String[] entries = resources.list(source);
+                for (String entry : entries) {
+                    String childDest = dest;
+                    if (!childDest.equals("/")) {
+                        childDest += "/";
+                    }
+                    childDest += entry;
+                    String childSrc = source;
+                    if (!childSrc.equals("/")) {
+                        childSrc += "/";
+                    }
+                    childSrc += entry;
                     copyResource(errorList, childSrc, childDest, true);
                 }
             }


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

Reply via email to