refactor(sftp): Replace hard-coded path separators with Pfs.seperator (#993)
Unify the use of Pfs.seperator for handling file path separators to enhance cross-platform compatibility.
This commit is contained in:
@@ -585,7 +585,11 @@ extension _Actions on _SftpPageState {
|
||||
|
||||
/// Local file dir + server id + remote path
|
||||
String _getLocalPath(String remotePath) {
|
||||
return Paths.file.joinPath(widget.args.spi.oldId).joinPath(remotePath);
|
||||
var normalizedPath = remotePath.replaceAll('/', Pfs.seperator);
|
||||
if (normalizedPath.startsWith(Pfs.seperator)) {
|
||||
normalizedPath = normalizedPath.substring(1);
|
||||
}
|
||||
return Paths.file.joinPath(widget.args.spi.id).joinPath(normalizedPath);
|
||||
}
|
||||
|
||||
/// Only return true if the path is changed
|
||||
|
||||
Reference in New Issue
Block a user