Script 'game-add': fix the length of game record.

This commit is contained in:
vonavi 2014-12-13 21:48:24 +03:00
parent bdc1411b4e
commit 9dd00b2eb0

View File

@ -277,8 +277,8 @@ function game_update_info {
local result= local result=
game_get_result game_get_result
local spaces=$(( length_max - rec_length )) local spaces=$(( length_max - rec_length )) sep=
local sep=$(printf "%${spaces}s" " ") (( spaces != 0 )) && sep=$(printf "%${spaces}s" " ")
echo "Updating file ${tour_info}..." echo "Updating file ${tour_info}..."
sed -E -i.orig \ sed -E -i.orig \
"s|^${date_re}( +${white} +- +${black}).*|${game_date}\1${sep}${result}|" \ "s|^${date_re}( +${white} +- +${black}).*|${game_date}\1${sep}${result}|" \