From e05dc3ad4aed052c92501f4473c9b4af0bfd2ebf Mon Sep 17 00:00:00 2001 From: Christian Duerr Date: Sat, 22 Jan 2022 23:48:44 +0100 Subject: [PATCH] Fix logfile overwriting existing files --- CHANGELOG.md | 1 + alacritty/src/logging.rs | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index bffa6770..3ca4ba9f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -41,6 +41,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). - Vi cursor on topmost of the display moving downward when scrolled into history with active output - Input lag on Wayland with Nvidia binary driver - Crash when hovering the mouse over fullwidth characters +- Do not create logfile if the file already exists ### Removed diff --git a/alacritty/src/logging.rs b/alacritty/src/logging.rs index 3ac40e4b..f3405e58 100644 --- a/alacritty/src/logging.rs +++ b/alacritty/src/logging.rs @@ -184,7 +184,7 @@ impl OnDemandLogFile { // Create the file if it doesn't exist yet. if self.file.is_none() { - let file = OpenOptions::new().append(true).create(true).open(&self.path); + let file = OpenOptions::new().append(true).create_new(true).open(&self.path); match file { Ok(file) => {