callback.c : less magic progress bars
commite5dce888c09976f1ef4664613c742d0d015e534e
authorXavier Chantry <shiningxc@gmail.com>
Wed, 16 Dec 2009 01:16:00 +0000 (16 02:16 +0100)
committerDan McGee <dan@archlinux.org>
Sun, 14 Mar 2010 23:39:26 +0000 (14 18:39 -0500)
tree2e22c2160d19ab6ae59257f2967bf5cdcea72def
parent087be2f1fbae2d7168732c7004d8963a3d9d21d8
callback.c : less magic progress bars

1 - Explain magic numbers

2 - There was a weird off by 1 mess in the progress bar. The code supposedly
shared the width between 50 chars for text (textlen) and the rest for the
progress bar (proglen = getcols() - textlen).
But the code actually used textlen + 1 for the text and proglen - 1 for the
progress bar (with haslen=1, the progress bar was actually empty), which was
a bit confusing so I changed it.

Signed-off-by: Xavier Chantry <shiningxc@gmail.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
src/pacman/callback.c