mirror of
https://gitee.com/dromara/hutool.git
synced 2025-04-05 17:37:59 +08:00
修复"多次替换home目录"错误
This commit is contained in:
parent
dca24eab36
commit
e2083b6065
@ -1423,7 +1423,7 @@ public class FileUtil extends PathUtil {
|
||||
|
||||
// 识别home目录形式,并转换为绝对路径
|
||||
if (pathToUse.startsWith("~")) {
|
||||
pathToUse = pathToUse.replace("~", getUserHomePath());
|
||||
pathToUse = pathToUse.replaceFirst("~", getUserHomePath());
|
||||
}
|
||||
|
||||
// 统一使用斜杠
|
||||
|
Loading…
Reference in New Issue
Block a user