XX
echo -n ''
else
if [[ $lastonly -eq 0 ]]; then
echo ""
fi
fi
if [[ $lastonly -eq 0 ]]; then
echo ""
fi
lastonly=1
elif [[ "$t4" == 'diff' ]]; then
cls='diff'
if [[ $diffseen -eq 0 ]]; then
diffseen=1
echo -n ''
else
echo "
"
fi
echo ""
lastonly=0
elif [[ "$t3" == '+++' ]]; then
cls='plus3'
lastonly=0
elif [[ "$t3" == '---' ]]; then
cls='minus3'
lastonly=0
elif [[ "$t2" == '@@' ]]; then
cls='at2'
lastonly=0
elif [[ "$t1" == '+' ]]; then
cls='plus'
lastonly=0
elif [[ "$t1" == '-' ]]; then
cls='minus'
lastonly=0
else
cls=
lastonly=0
fi
# Convert &, <, > to HTML entities.
s=$(sed -e 's/\&/\&/g' -e 's/\</g' -e 's/>/\>/g' <<<"$s")
if [[ $first -eq 1 ]]; then
first=0
else
echo
fi
# Output the line.
if [[ "$cls" ]]; then
echo -n ''${s}''
else
echo -n ${s}
fi
read -r s
done
IFS=$OIFS
if [[ $diffseen -eq 0 && $onlyseen -eq 0 ]]; then
echo -n ''
else
echo "
"
fi
echo
cat <