Skip to content

Commit

Permalink
fix(core/windows): Remove UNC prefix from tempdir fn (#10288)
Browse files Browse the repository at this point in the history
fixes #10285
  • Loading branch information
FabianLars authored Jul 15, 2024
1 parent 9d8df7c commit 56ffd29
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changes/fix-remove-tempdir-unc-prefix.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
tauri: "patch:bug"
---

Fixed a regression that added the `\\?\` UNC prefix to the path returned from the `tempdir()` command.
7 changes: 6 additions & 1 deletion core/tauri/src/endpoints/operating_system.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,12 @@ impl Cmd {
}

fn tempdir<R: Runtime>(_context: InvokeContext<R>) -> super::Result<PathBuf> {
Ok(std::env::temp_dir().canonicalize()?)
#[cfg(windows)]
use dunce::canonicalize;
#[cfg(not(windows))]
use std::fs::canonicalize;

Ok(canonicalize(std::env::temp_dir())?)
}

fn locale<R: Runtime>(_context: InvokeContext<R>) -> super::Result<Option<String>> {
Expand Down

0 comments on commit 56ffd29

Please sign in to comment.