ncal: always generate full lines to enable today hilight in year view
authorSimon Schubert <corecode@dragonflybsd.org>
Wed, 6 May 2009 09:00:23 +0000 (11:00 +0200)
committerSimon Schubert <corecode@dragonflybsd.org>
Wed, 6 May 2009 21:29:14 +0000 (23:29 +0200)
commit5a8256dd5646d3f6d6802bb9eb41f286e965d317
tree5c8564008a9b90b8d003f14821bac6108c45f9e4
parente293de53516423462dd73b09574e7177868f55d9
ncal: always generate full lines to enable today hilight in year view

Ncal would only fill lines up to the last day in a month and use a printf
padding later to align all output nicely (when using year view).  This
breaks when using a hilight, because the ANSI sequences consume additional
characters which are of zero print width.  Instead of letting printf do
the padding, generate padded lines ourselves.

Also avoid code duplication in the hilight code and switch on hilighting
for the year view.
usr.bin/ncal/ncal.c