mirror of
https://github.com/arkenfox/user.js.git
synced 2025-04-21 16:16:50 -04:00
Update updater.sh
> If you do not give `read` any arguments to use to hold the input (relying on the default variable `REPLY`), no whitespace is stripped and you can omit the modification to `IFS`. That is, `while read -r; do printf '%s\n' "$REPLY"; done < "$file"` from a comment by chepner in response to the answer at https://stackoverflow.com/a/29689199 thanks chepner
This commit is contained in:
parent
eeaccf6508
commit
972c227fd7
@ -320,12 +320,10 @@ update_userjs () {
|
||||
diff=$(sdiff -s -w 1000 $past_nocomments $current_nocomments)
|
||||
if [ ! -z "$diff" ]; then
|
||||
local leasttabs=999999
|
||||
local oldIFS=$IFS
|
||||
while IFS= read -r line; do
|
||||
ntabs=$(printf '%s\n' "$line" | tr -c -d "\t" | wc -c)
|
||||
while read -r; do
|
||||
ntabs=$(printf '%s\n' "$REPLY" | tr -c -d "\t" | wc -c)
|
||||
if [ $ntabs -lt $leasttabs ]; then leasttabs=$ntabs; fi
|
||||
done <<< "$diff"
|
||||
IFS=$oldIFS
|
||||
if [ $leasttabs -lt 2 ]; then
|
||||
echo "$diff" > "$diffname"
|
||||
else
|
||||
|
Loading…
x
Reference in New Issue
Block a user