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:
earthlng 2018-11-26 19:32:30 +00:00 committed by GitHub
parent eeaccf6508
commit 972c227fd7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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