From ae446a47ab0097575193a24684174cf3c972e40f Mon Sep 17 00:00:00 2001 From: Kenneth Loeffler Date: Tue, 23 Apr 2024 09:15:38 -0700 Subject: [PATCH] Fix stripping EXE_EXTENSION instead of EXE_SUFFIX (#10) Thank you for fixing this!! --- lib/system/current.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/system/current.rs b/lib/system/current.rs index cbfafd7..39f31f3 100644 --- a/lib/system/current.rs +++ b/lib/system/current.rs @@ -1,5 +1,5 @@ use std::{ - env::{self, consts::EXE_EXTENSION}, + env::{self, consts::EXE_SUFFIX}, path::PathBuf, }; @@ -57,11 +57,11 @@ pub fn current_exe_name() -> String { // NOTE: Shells on Windows can be weird sometimes and pass arg0 // using either a lowercase or uppercase extension, so we fix that - let exe_name = if EXE_EXTENSION.is_empty() { + let exe_name = if EXE_SUFFIX.is_empty() { exe_name } else { - let suffix_lower = EXE_EXTENSION.to_ascii_lowercase(); - let suffix_upper = EXE_EXTENSION.to_ascii_uppercase(); + let suffix_lower = EXE_SUFFIX.to_ascii_lowercase(); + let suffix_upper = EXE_SUFFIX.to_ascii_uppercase(); if let Some(stripped) = exe_name.strip_suffix(&suffix_lower) { stripped } else if let Some(stripped) = exe_name.strip_suffix(&suffix_upper) {