From a50a24ea5c153bde30ec8652aff2a4eeb90ad82d Mon Sep 17 00:00:00 2001 From: Frotty Date: Fri, 23 Jan 2026 12:07:21 +0100 Subject: [PATCH] fix wrappers --- Wurstpack/wurstscript/grill.cmd | 7 ++++--- Wurstpack/wurstscript/wurstscript.cmd | 7 ++++--- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/Wurstpack/wurstscript/grill.cmd b/Wurstpack/wurstscript/grill.cmd index 76b86578a..f8640bc20 100644 --- a/Wurstpack/wurstscript/grill.cmd +++ b/Wurstpack/wurstscript/grill.cmd @@ -1,8 +1,8 @@ @echo off -setlocal +setlocal EnableExtensions DisableDelayedExpansion -rem Save current code page -for /f "tokens=2 delims=: " %%A in ('chcp') do set "_OLDCP=%%A" +rem Save current code page (extract number after ':') +for /f "tokens=2 delims=:" %%A in ('chcp') do for /f "tokens=1" %%B in ("%%A") do set "_OLDCP=%%B" rem Switch to UTF-8 for this session chcp 65001 >NUL @@ -38,3 +38,4 @@ rem Restore previous code page if we captured it if defined _OLDCP chcp %_OLDCP% >NUL endlocal +exit /b %ERRORLEVEL% diff --git a/Wurstpack/wurstscript/wurstscript.cmd b/Wurstpack/wurstscript/wurstscript.cmd index 0fecaf520..95000308f 100644 --- a/Wurstpack/wurstscript/wurstscript.cmd +++ b/Wurstpack/wurstscript/wurstscript.cmd @@ -1,8 +1,8 @@ @echo off -setlocal +setlocal EnableExtensions DisableDelayedExpansion -rem Save current code page -for /f "tokens=2 delims=: " %%A in ('chcp') do set "_OLDCP=%%A" +rem Save current code page (extract number after ':') +for /f "tokens=2 delims=:" %%A in ('chcp') do for /f "tokens=1" %%B in ("%%A") do set "_OLDCP=%%B" rem Switch to UTF-8 chcp 65001 >NUL @@ -34,3 +34,4 @@ if not exist "%JAVA%" ( :restore if defined _OLDCP chcp %_OLDCP% >NUL endlocal +exit /b %ERRORLEVEL%