zsh-workers
 help / color / mirror / code / Atom feed
From: Peter Stephenson <p.w.stephenson@ntlworld.com>
To: zsh-workers <zsh-workers@sunsite.dk>
Subject: Re: multibyte/utf8/unicode issues with 'sched' builtin
Date: Tue, 25 Mar 2008 17:34:41 +0000	[thread overview]
Message-ID: <20080325173441.5f68db0c@pws-pc> (raw)
In-Reply-To: <237967ef0803212059r1bb3b8b9t9d6dfde0b64a5a53@mail.gmail.com>

On Sat, 22 Mar 2008 04:59:02 +0100
"Mikael Magnusson" <mikachu@gmail.com> wrote:
> % LC_ALL=sv_SE.UTF-8 zsh -f
> % sched +1 true; sched
>   1 lör mar 22  4:57pاÄ true
> ^[[?1;2c
> % 1;2c
> 
> not so good.

I hope it's this simple, if not I'll wait till Saturday and look
again...  I haven't scientifically counted how many characters we are
theoretically liable for, but adding another 20 to cover the remains of
the day, month and am/pm should surely be enough, shouldn't it?

Index: Src/Builtins/sched.c
===================================================================
RCS file: /cvsroot/zsh/zsh/Src/Builtins/sched.c,v
retrieving revision 1.13
diff -u -r1.13 sched.c
--- Src/Builtins/sched.c	6 Jul 2007 21:52:40 -0000	1.13
+++ Src/Builtins/sched.c	25 Mar 2008 17:33:27 -0000
@@ -205,13 +205,13 @@
     /* given no arguments, display the schedule list */
     if (!*argptr) {
 	for (sn = 1, sch = schedcmds; sch; sch = sch->next, sn++) {
-	    char tbuf[40], *flagstr, *endstr;
+	    char tbuf[60], *flagstr, *endstr;
 	    time_t t;
 	    struct tm *tmp;
 
 	    t = sch->time;
 	    tmp = localtime(&t);
-	    ztrftime(tbuf, 20, "%a %b %e %k:%M:%S", tmp);
+	    ztrftime(tbuf, 40, "%a %b %e %k:%M:%S", tmp);
 	    if (sch->flags & SCHEDFLAG_TRASH_ZLE)
 		flagstr = "-o ";
 	    else

-- 
Peter Stephenson <p.w.stephenson@ntlworld.com>
Web page now at http://homepage.ntlworld.com/p.w.stephenson/


      parent reply	other threads:[~2008-03-25 17:35 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-03-22  3:59 Mikael Magnusson
2008-03-23  1:00 ` Bart Schaefer
2008-03-25 17:34 ` Peter Stephenson [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20080325173441.5f68db0c@pws-pc \
    --to=p.w.stephenson@ntlworld.com \
    --cc=zsh-workers@sunsite.dk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).