[
https://issues.apache.org/jira/browse/IO-552?focusedWorklogId=678242&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-678242
]
ASF GitHub Bot logged work on IO-552:
-------------------------------------
Author: ASF GitHub Bot
Created on: 06/Nov/21 22:52
Start Date: 06/Nov/21 22:52
Worklog Time Spent: 10m
Work Description: kinow commented on a change in pull request #297:
URL: https://github.com/apache/commons-io/pull/297#discussion_r744176872
##########
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:
Would this work too?
```suggestion
if (prefix > 0 && !fullFileNameToAdd.startsWith("~")) {
```
--
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]
Issue Time Tracking
-------------------
Worklog Id: (was: 678242)
Time Spent: 50m (was: 40m)
> FilenameUtils.concat fails if second argument (fullFilenameToAdd) starts with
> '~' (tilde)
> -----------------------------------------------------------------------------------------
>
> Key: IO-552
> URL: https://issues.apache.org/jira/browse/IO-552
> Project: Commons IO
> Issue Type: Bug
> Components: Utilities
> Affects Versions: 2.2, 2.5
> Environment: Windows 7 64bit, JavaVM 1.8 32bit
> Reporter: Jochen Tümmers
> Priority: Critical
> Time Spent: 50m
> Remaining Estimate: 0h
>
> {{FilenameUtils.concat("c:/temp", "~abc.txt") returns "~abc.txt/" instead of
> "c:/temp/~abc.txt".}}
> As a result, the file would be created in the user's home directory instead
> of c:/temp.
> (Note: I Had to replace all instances of double backslashes that would
> normally appear in the java code with forward slashes as the editor cannot
> handle backslashes properly.)
> commons io 2.2. and 2.5 behave the same. 2.3 and 2.4 not tested.
--
This message was sent by Atlassian Jira
(v8.20.1#820001)