kinow commented on a change in pull request #297:
URL: https://github.com/apache/commons-io/pull/297#discussion_r744177106



##########
File path: src/main/java/org/apache/commons/io/FilenameUtils.java
##########
@@ -201,7 +201,7 @@ public static String concat(final String basePath, final 
String fullFileNameToAd
         if (prefix < 0) {
             return null;
         }
-        if (prefix > 0) {
+        if (prefix > 0 && !fullFileNameToAdd.isEmpty() && '~' != 
(fullFileNameToAdd.charAt(0))) {

Review comment:
       (I think the `startsWith` handles case of empty strings.

##########
File path: src/main/java/org/apache/commons/io/FilenameUtils.java
##########
@@ -201,7 +201,7 @@ public static String concat(final String basePath, final 
String fullFileNameToAd
         if (prefix < 0) {
             return null;
         }
-        if (prefix > 0) {
+        if (prefix > 0 && !fullFileNameToAdd.isEmpty() && '~' != 
(fullFileNameToAdd.charAt(0))) {

Review comment:
       (I think the `startsWith` handles case of empty strings.)




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to