summaryrefslogtreecommitdiff
path: root/alacritty_terminal/src/tty/windows
diff options
context:
space:
mode:
authorChristian Duerr <contact@christianduerr.com>2020-01-12 01:24:56 +0100
committerGitHub <noreply@github.com>2020-01-12 01:24:56 +0100
commit09ed64bd365bdb294a29e2e6b0149b0581a1fa81 (patch)
treea6c8ba50b47b806f1bc82847198d070d66633984 /alacritty_terminal/src/tty/windows
parenta82df6ac4309f16bd1c75d13f1f4f1b9f79582eb (diff)
downloadalacritty-09ed64bd365bdb294a29e2e6b0149b0581a1fa81.tar.gz
alacritty-09ed64bd365bdb294a29e2e6b0149b0581a1fa81.zip
Fix crash with invalid working directory
Diffstat (limited to 'alacritty_terminal/src/tty/windows')
-rw-r--r--alacritty_terminal/src/tty/windows/conpty.rs6
-rw-r--r--alacritty_terminal/src/tty/windows/winpty.rs2
2 files changed, 4 insertions, 4 deletions
diff --git a/alacritty_terminal/src/tty/windows/conpty.rs b/alacritty_terminal/src/tty/windows/conpty.rs
index 28cdf4c4..0bed412b 100644
--- a/alacritty_terminal/src/tty/windows/conpty.rs
+++ b/alacritty_terminal/src/tty/windows/conpty.rs
@@ -204,9 +204,9 @@ pub fn new<C>(config: &Config<C>, size: &SizeInfo, _window_id: Option<usize>) ->
let cmdline = win32_string(&cmdline(&config));
let cwd = config
- .working_directory()
- .map(|dir| dir.canonicalize().unwrap())
- .map(|path| win32_string(&path));
+ .working_directory
+ .as_ref()
+ .map(|pb| win32_string(&pb.as_path().canonicalize().unwrap()));
let mut proc_info: PROCESS_INFORMATION = Default::default();
unsafe {
diff --git a/alacritty_terminal/src/tty/windows/winpty.rs b/alacritty_terminal/src/tty/windows/winpty.rs
index c56ad8f6..2eccecbf 100644
--- a/alacritty_terminal/src/tty/windows/winpty.rs
+++ b/alacritty_terminal/src/tty/windows/winpty.rs
@@ -42,7 +42,7 @@ pub fn new<C>(config: &Config<C>, size: &SizeInfo, _window_id: Option<usize>) ->
let (conin, conout) = (agent.conin_name(), agent.conout_name());
let cmdline = cmdline(&config);
- let cwd = config.working_directory().map(|dir| dir.canonicalize().unwrap());
+ let cwd = config.working_directory.as_ref().map(|pb| pb.as_path().canonicalize().unwrap());
// Spawn process
let spawnconfig = SpawnConfig::new(