Re: Bug#160282: cal: Should use the latter Chinese char for day of the week
On Tue, Sep 17, 2002 at 12:16:27AM +0800, Rex Tsai wrote:
>
> - patch -
> diff -u usr.bin/ncal/ncal.c.orig usr.bin/ncal/ncal.c|more
> --- usr.bin/ncal/ncal.c.orig Mon Sep 16 22:21:05 2002
> +++ usr.bin/ncal/ncal.c Mon Sep 16 23:47:01 2002
> @@ -783,10 +783,13 @@
> len = mbstowcs(NULL, buf, 0);
> wcs = calloc(len + 1, sizeof(wchar_t));
> mbstowcs(wcs, buf, len);
> - for (j = 0; j < len; j++)
> + if(len == wcswidth(wcs, (size_t)10)) {
for (size_t)10, if you can replace it with 'len', it's better
not to use some magic number. :)
Maybe you can supply your patch to the bug reported by Danny.
As a temperal solution since someone suggested to change the
abday inside the libc in the future.
Maybe not temperal since other locales might has the similar
problem.
> + for (j = 0; j < len; j++)
> if (wcswidth(wcs, j + 1) >= 2)
> - break;
> - wcs[j + 1] = L'\0';
> + break;
> + wcs[j+1] = L'\0';
> + }
> +
> col = wcswidth(wcs, j + 1);
> len = wcstombs(NULL, wcs, 0);
> wds->names[i] = calloc(len + 2 - col + 1, sizeof(char));
> - patch -
>
> 看起来 util-linux 中的 cal 比较适合 Linux 使用,希望 Debian 以后是使用这一
> 套。我希望能将他修正成日子与星期的排列是对齐的,这样会美观许多。
>
--
Best regard
hashao
--
To UNSUBSCRIBE, email to debian-chinese-big5-request@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
--
| This message was re-posted from debian-chinese-big5@lists.debian.org
| and converted from big5 to gb2312 by an automatic gateway.
Reply to: