mirror of
https://github.com/veeso/termscp.git
synced 2025-12-07 09:36:00 -08:00
Fixed file extension not found in SCP/FTP
This commit is contained in:
@@ -190,11 +190,12 @@ impl FtpFileTransfer {
|
|||||||
return Err(());
|
return Err(());
|
||||||
}
|
}
|
||||||
let mut abs_path: PathBuf = PathBuf::from(path);
|
let mut abs_path: PathBuf = PathBuf::from(path);
|
||||||
|
abs_path.push(file_name.as_str());
|
||||||
|
// get extension
|
||||||
let extension: Option<String> = match abs_path.as_path().extension() {
|
let extension: Option<String> = match abs_path.as_path().extension() {
|
||||||
None => None,
|
None => None,
|
||||||
Some(s) => Some(String::from(s.to_string_lossy())),
|
Some(s) => Some(String::from(s.to_string_lossy())),
|
||||||
};
|
};
|
||||||
abs_path.push(file_name.as_str());
|
|
||||||
// Return
|
// Return
|
||||||
// Push to entries
|
// Push to entries
|
||||||
Ok(match is_dir {
|
Ok(match is_dir {
|
||||||
|
|||||||
@@ -189,11 +189,12 @@ impl ScpFileTransfer {
|
|||||||
return Err(());
|
return Err(());
|
||||||
}
|
}
|
||||||
let mut abs_path: PathBuf = PathBuf::from(path);
|
let mut abs_path: PathBuf = PathBuf::from(path);
|
||||||
|
abs_path.push(file_name.as_str());
|
||||||
|
// Get extension
|
||||||
let extension: Option<String> = match abs_path.as_path().extension() {
|
let extension: Option<String> = match abs_path.as_path().extension() {
|
||||||
None => None,
|
None => None,
|
||||||
Some(s) => Some(String::from(s.to_string_lossy())),
|
Some(s) => Some(String::from(s.to_string_lossy())),
|
||||||
};
|
};
|
||||||
abs_path.push(file_name.as_str());
|
|
||||||
// Return
|
// Return
|
||||||
// Push to entries
|
// Push to entries
|
||||||
Ok(match is_dir {
|
Ok(match is_dir {
|
||||||
|
|||||||
Reference in New Issue
Block a user