1.0b2 Fix for long lines

Fixed long lines getting truncated.
Improved other aspects for performance.
This commit is contained in:
claustromaniac 2017-12-13 04:18:10 +00:00
parent 68d20d0f76
commit f07bbb6c85

View file

@ -3,7 +3,7 @@ TITLE prefs.js cleaner
REM ### prefs.js cleaner for Windows REM ### prefs.js cleaner for Windows
REM ## author: @claustromaniac REM ## author: @claustromaniac
REM ## version: 1.0b REM ## version: 1.0b2
SETLOCAL EnableDelayedExpansion SETLOCAL EnableDelayedExpansion
CALL :message "This batch should be run from your Firefox profile directory. It will remove from prefs.js any entries that exist in user.js, allowing inactive preferences to reset to default value." CALL :message "This batch should be run from your Firefox profile directory. It will remove from prefs.js any entries that exist in user.js, allowing inactive preferences to reset to default value."
@ -26,7 +26,7 @@ REM ######### Cleanup Function ##########
:cleanup :cleanup
SETLOCAL DisableDelayedExpansion SETLOCAL DisableDelayedExpansion
( (
FOR /F "tokens=1,* delims=]" %%G IN ('FIND /N /V "" ^< "prefs.js"') DO ( FOR /F "tokens=1,* delims=:" %%G IN ( 'FINDSTR /N "^" prefs.js' ) DO (
SET "_line=%%H" SET "_line=%%H"
SETLOCAL EnableDelayedExpansion SETLOCAL EnableDelayedExpansion
SET "_pref=!_line: =!" SET "_pref=!_line: =!"
@ -35,10 +35,10 @@ SETLOCAL DisableDelayedExpansion
SET _pref=!_pref:"=""! SET _pref=!_pref:"=""!
FIND /I "!_pref!" user.js >nul FIND /I "!_pref!" user.js >nul
IF ERRORLEVEL 1 ( IF ERRORLEVEL 1 (
ECHO(!_line! ECHO:!_line!
) )
) ELSE ( ) ELSE (
ECHO(!_line! ECHO:!_line!
) )
ENDLOCAL ENDLOCAL
) )
@ -48,14 +48,13 @@ MOVE /Y newprefs.js prefs.js
GOTO :EOF GOTO :EOF
REM ########## Message Function ######### REM ########## Message Function #########
:message :message
ECHO. ECHO:
ECHO %~1 ECHO:%~1
ECHO. ECHO:
GOTO :EOF GOTO :EOF
REM ########## Abort Function ########### REM ########## Abort Function ###########
:abort :abort
CALL :message %1 CALL :message %1
ECHO.
TIMEOUT %~2 >nul TIMEOUT %~2 >nul
EXIT EXIT
REM ##################################### REM #####################################