mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-06-10 21:11:15 -03:00
committed by
Johannes Altmanninger
parent
43513d3fca
commit
44f9363e39
@@ -478,7 +478,7 @@ fn try_rewriting<F, UserData>(
|
||||
.as_ref()
|
||||
.is_ok_and(|(_file_id, potential_update)| !potential_update.do_save)
|
||||
{
|
||||
wunlink(&tmp_name);
|
||||
let _ = wunlink(&tmp_name);
|
||||
}
|
||||
result
|
||||
}
|
||||
|
||||
@@ -831,7 +831,7 @@ fn clear(&mut self) {
|
||||
self.first_unwritten_new_item_index = 0;
|
||||
self.file_contents = None;
|
||||
if let Ok(Some(filename)) = self.history_file_path() {
|
||||
wunlink(&filename);
|
||||
let _ = wunlink(&filename);
|
||||
}
|
||||
self.clear_file_state();
|
||||
}
|
||||
|
||||
@@ -59,9 +59,9 @@ pub fn waccess(file_name: &wstr, mode: libc::c_int) -> libc::c_int {
|
||||
}
|
||||
|
||||
/// Wide character version of unlink().
|
||||
pub fn wunlink(file_name: &wstr) -> libc::c_int {
|
||||
let tmp = wcs2zstring(file_name);
|
||||
unsafe { libc::unlink(tmp.as_ptr()) }
|
||||
pub fn wunlink(file_name: &wstr) -> io::Result<()> {
|
||||
let tmp = wcs2osstring(file_name);
|
||||
fs::remove_file(tmp)
|
||||
}
|
||||
|
||||
pub fn wperror(s: &wstr) {
|
||||
|
||||
Reference in New Issue
Block a user