From a126a3210907093af30156fbbeba06666eaa5ab9 Mon Sep 17 00:00:00 2001 From: claustromaniac <20734810+claustromaniac@users.noreply.github.com> Date: Wed, 29 Nov 2017 15:18:23 +0000 Subject: [PATCH] Revert "2nd merge optimisation" This reverts commit c9e7f1ccfa6ff028151a5b7cf0dc2f60303dd831. --- updater.bat | 51 +++++++++++++++++++++++++-------------------------- 1 file changed, 25 insertions(+), 26 deletions(-) diff --git a/updater.bat b/updater.bat index 6eb9a3b..bada83f 100644 --- a/updater.bat +++ b/updater.bat @@ -39,7 +39,7 @@ IF DEFINED _updateb ( IF NOT "!_myname:~0,9!"=="[updated]" ( ECHO Checking updater version... ECHO. - IF EXIST "[updated]!_myname!.bat" ( DEL /F "[updated]!_myname!.bat" ) + DEL /F "[updated]!_myname!.bat" 2>nul REM Uncomment the next line and comment the powershell call for testing. REM COPY /B /V /Y "!_myname!.bat" "[updated]!_myname!.bat" ( @@ -207,38 +207,37 @@ EXIT /B REM ###### Merge function ###### :merge +DEL /F %2 2>nul SETLOCAL disabledelayedexpansion -( - FOR /F "tokens=1,* delims=]" %%G IN ('find /n /v "" ^< "%~1"') DO ( - SET "_pref=%%H" - SETLOCAL enabledelayedexpansion - SET "_temp=!_pref: =!" - IF /I "user_pref"=="!_temp:~0,9!" ( - IF /I NOT "user.js.parrot"=="!_temp:~12,14!" ( - FOR /F "delims=," %%S IN ("!_pref!") DO ( - SET "_pref=%%S" - ) - SET _pref=!_pref:"=""! - FIND /I "!_pref!" %~2 >nul 2>&1 - IF ERRORLEVEL 1 ( - FOR /F "tokens=* delims=" %%X IN ('FIND /I "!_pref!" %~1') DO ( - SET "_temp=%%X" - SET "_temp=!_temp: =!" - IF /I "user_pref"=="!_temp:~0,9!" ( - SET "_pref=%%X" - ) +FOR /F "tokens=1,* delims=]" %%G IN ('find /n /v "" ^< "%~1"') DO ( + SET "_pref=%%H" + SETLOCAL enabledelayedexpansion + SET "_temp=!_pref: =!" + IF /I "user_pref"=="!_temp:~0,9!" ( + IF /I NOT "user.js.parrot"=="!_temp:~12,14!" ( + FOR /F "delims=," %%S IN ("!_pref!") DO ( + SET "_pref=%%S" + ) + SET _pref=!_pref:"=""! + FIND /I "!_pref!" %~2 >nul 2>&1 + IF ERRORLEVEL 1 ( + FOR /F "tokens=* delims=" %%X IN ('FIND /I "!_pref!" %~1') DO ( + SET "_temp=%%X" + SET "_temp=!_temp: =!" + IF /I "user_pref"=="!_temp:~0,9!" ( + SET "_pref=%%X" ) - ECHO(!_pref! ) - ) ELSE ( - ECHO(!_pref! + ECHO(!_pref!>>%~2 ) ) ELSE ( - ECHO(!_pref! + ECHO(!_pref!>>%~2 ) - ENDLOCAL + ) ELSE ( + ECHO(!_pref!>>%~2 ) -)>%~2 + ENDLOCAL +) ENDLOCAL DEL /F %1 >nul GOTO :EOF