summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAzad <49314270+Akmadan23@users.noreply.github.com>2024-02-28 02:16:12 +0100
committerGitHub <noreply@github.com>2024-02-27 20:16:12 -0500
commit0796039c8a135951e1bff3654cd7a2dc8039c0fe (patch)
treecfcc54e311c2cb2b7de090f45ad0e78421e5dcfc
parent83a906a930241f2f5121d879da1b20ba4d2f62da (diff)
fix: escape `'` char in trash operations (#501)
* fix: escape `'` char during trash operations * clippy
-rw-r--r--src/io/io_worker.rs6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/io/io_worker.rs b/src/io/io_worker.rs
index 4346437..189e9fc 100644
--- a/src/io/io_worker.rs
+++ b/src/io/io_worker.rs
@@ -356,7 +356,11 @@ fn trash_file<P>(file_path: P) -> AppResult
where
P: AsRef<path::Path>,
{
- let file_path_str = file_path.as_ref().as_os_str().to_string_lossy();
+ let file_path_str = file_path
+ .as_ref()
+ .as_os_str()
+ .to_string_lossy()
+ .replace('\'', "'\\''");
let clipboards = [
("gio trash", format!("gio trash -- '{}'", file_path_str)),