Skip to content

Commit

Permalink
build: modify echolib.bat to minimize environment use and args check (#…
Browse files Browse the repository at this point in the history
…117)

- change to be similar as echoto.bat nethod
- no more then 10 parameters are used
- add arguments overflow check to echolib.bat
- add arguments overflow check to echoto.bat
  • Loading branch information
jmalak authored Dec 23, 2024
1 parent 1256925 commit 8ce6c95
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 12 deletions.
17 changes: 5 additions & 12 deletions scripts/echolib.bat
Original file line number Diff line number Diff line change
@@ -1,15 +1,8 @@
@echo off
set FILE=%1
set STR=+%2

:loop
shift
if "%2" == "" goto end
set STR=%STR% +%2
goto loop
:end

if "%2%3%4%5%6%7%8%9" == "" goto nothing
set AMP=&
if "%AMP%" == "" set AMP=^^^&

echo %STR% %AMP%>> %FILE%
echo %2 %3 %4 %5 %6 %7 %8 %9 %AMP%>>%1
shift
if not "%9" == "" echo echolib.bat arguments overflow
:nothing
2 changes: 2 additions & 0 deletions scripts/echoto.bat
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
@echo off
if "%2%3%4%5%6%7%8%9" == "" goto nothing
echo %2 %3 %4 %5 %6 %7 %8 %9 >>%1
shift
if not "%9" == "" echo echoto.bat arguments overflow
:nothing

0 comments on commit 8ce6c95

Please # to comment.