From d1b1012741d571379536d7ad0a37d62dad2effb7 Mon Sep 17 00:00:00 2001 From: David Refoua Date: Fri, 9 Sep 2022 17:24:25 +0430 Subject: [PATCH] minimal comspec detection (fixes #2744) --- vendor/lib/lib_base.cmd | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/vendor/lib/lib_base.cmd b/vendor/lib/lib_base.cmd index 6f2ed3095..8c0fda839 100644 --- a/vendor/lib/lib_base.cmd +++ b/vendor/lib/lib_base.cmd @@ -61,22 +61,21 @@ exit /b ::: file full path to file containing lib_routines to display :::. :::------------------------------------------------------------------------------- - echo %comspec% | %WINDIR%\System32\find /i "\cmd.exe" > nul && set "CMDER_SHELL=cmd" - echo %comspec% | %WINDIR%\System32\find /i "\tcc.exe" > nul && set "CMDER_SHELL=tcc" - echo %comspec% | %WINDIR%\System32\find /i "\tccle" > nul && set "CMDER_SHELL=tccle" - + call :detect_comspec %ComSpec% + exit /b + +:detect_comspec + CMDER_SHELL=%~n1 if not defined CMDER_CLINK ( set CMDER_CLINK=1 if "%CMDER_SHELL%" equ "tcc" set CMDER_CLINK=0 if "%CMDER_SHELL%" equ "tccle" set CMDER_CLINK=0 ) - if not defined CMDER_ALIASES ( set CMDER_ALIASES=1 if "%CMDER_SHELL%" equ "tcc" set CMDER_ALIASES=0 if "%CMDER_SHELL%" equ "tccle" set CMDER_ALIASES=0 ) - exit /b :update_legacy_aliases