Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: multibyte/utf8/unicode issues with 'sched' builtin



On Sat, 22 Mar 2008 04:59:02 +0100
"Mikael Magnusson" <mikachu@xxxxxxxxx> 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@xxxxxxxxxxxx>
Web page now at http://homepage.ntlworld.com/p.w.stephenson/



Messages sorted by: Reverse Date, Date, Thread, Author