Re: [PATCH] cal: Output unaligned with "-3" option and libtermcap

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Karel Zak wrote:
> On Thu, Feb 15, 2007 at 01:31:20PM +0000, Pádraig Brady wrote:
>> Karel Zak wrote:
>>>  Hi Christian,
>>>
>>>  some ideas from your patch are really good, but the rest is not so
>>>  perfect after all.
>> Sorry I missed the original mail/patch.
>> Can you send again?
> 
>  Done.
> 
>> For reference I did the "highlight today" functionality
>> in cal a couple of years back which has alignment issues,
>> and have been trying to get the fix in since then:
>> http://www.pixelbeat.org/patches/cal-2.12q-highlight.diff
> 
>  This patch is already in my mail box ;-)
> 
>  Well, Christian's patch is more about code refactoring rather than
>  about simple bug fix only. (It might good idea to cleanup the code.)

Yes the code can definitely be refactored.
I was wary of changing format though when I looked at it,
in case I broke scripts depending on whitespace etc.

> 
>> Incidentally I also fixed the weekday alignment for
>> multibyte locales in the changes I did a couple of years ago
> 
>  There is also other multibyte fix (by RH):
> 
>      http://people.redhat.com/kzak/util-linux/util-linux-2.12p-cal-wide.patch
> 
>  My plan is write some regression tests for the "cal" before playing
>  with these patches.

I used the following 2 scripts to test my changes:

[ ! -e "./cal" ] && CAL=cal || CAL=./cal
LANG=ga_IE.utf8 $CAL -3 11 2004 #truncation (first month)
LANG=zh_HK.utf8 $CAL -3         #multibyte centering
$CAL | cat  #no highlight
TERM= $CAL  #no highlight
TERM=vt100 $CAL  #highlight, with characters to be stripped by putp
$CAL -y | head | tr ' ' . #3 spaces between cols?
$CAL -3 | tr ' ' .        #2 spaces between cols and trailing spaces?


locale -a |
grep utf8 |
uniq -w2 |
while read LANG; do
    cal -3 |
    head -2 | tail -1;
done


Pádraig
-
To unsubscribe from this list: send the line "unsubscribe util-linux-ng" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux