1
0
Fork 0
- Fix for empty lines.
- Went back to using FIND in the main loop for the good reasons stated by @earthing
This commit is contained in:
claustromaniac 2017-12-17 15:01:06 +00:00
parent 240bcbfbee
commit c9f62822a6
1 changed files with 6 additions and 6 deletions

View File

@ -3,7 +3,7 @@ TITLE ghacks user.js updater
REM ### ghacks-user.js updater for Windows
REM ## author: @claustromaniac
REM ## version: 4.0b2
REM ## version: 4.0b3
SET _myname=%~n0
SET _myparams=%*
@ -200,15 +200,15 @@ REM ############ Merge function ############
SETLOCAL DisableDelayedExpansion
(
FOR /F "tokens=1,* delims=," %%G IN ('FINDSTR /B /I /C:"user_pref" "%~1"') DO (SET "%%G=%%H")
FOR /F "tokens=1,* delims=:" %%I IN ('FINDSTR /N "^" "%~1"') DO (
FOR /F "tokens=1,* delims=," %%K IN ("%%J") DO (
FOR /F "tokens=1,* delims=]" %%I IN ('FIND /N /V "" ^< "%~1"') DO (
FOR /F "delims=," %%K IN ("%%J") DO (
IF NOT [user_pref("_user.js.parrot"]==[%%K] (
IF DEFINED %%K (
SETLOCAL EnableDelayedExpansion
FOR /F "delims=" %%M IN ("!%%K!") DO (
FOR /F "delims=" %%L IN ("!%%K!") DO (
ENDLOCAL
IF NOT "%%M"=="ALREADY MERGED" (
ECHO:%%K,%%M
IF NOT "%%L"=="ALREADY MERGED" (
ECHO:%%K,%%L
SET "%%K=ALREADY MERGED"
)
)