[email protected] (Jérémie Courrèges-Anglas) writes: > Matthew Martin <[email protected]> writes: > >> zsh printf's a time_t as a long. The cast is so that I can send the >> same patch upstream (assuming that casting to long long is the correct >> fix). Bug found with clang. > > It looks like zsh does not assume long long and %lld support, so more > work might be needed for an upstream patch. > > However, ok jca@ to commit the patch below in the ports tree.
Here's a modified patch: Index: Makefile =================================================================== RCS file: /cvs/ports/shells/zsh/Makefile,v retrieving revision 1.79 diff -u -p -r1.79 Makefile --- Makefile 21 Dec 2015 19:13:17 -0000 1.79 +++ Makefile 21 Feb 2016 20:28:53 -0000 @@ -5,7 +5,7 @@ COMMENT= Z shell, Bourne shell-compatibl V= 5.2 DISTNAME= zsh-$V CATEGORIES= shells -REVISION= 2 +REVISION= 3 MAINTAINER= Pierre-Emmanuel Andre <[email protected]> Index: patches/patch-Src_Builtins_sched_c =================================================================== RCS file: patches/patch-Src_Builtins_sched_c diff -N patches/patch-Src_Builtins_sched_c --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ patches/patch-Src_Builtins_sched_c 21 Feb 2016 20:28:53 -0000 @@ -0,0 +1,16 @@ +$OpenBSD$ +--- Src/Builtins/sched.c.orig Thu Aug 20 21:59:47 2015 ++++ Src/Builtins/sched.c Sun Feb 21 21:03:19 2016 +@@ -353,7 +353,11 @@ schedgetfn(UNUSED(Param pm)) + time_t t; + + t = sch->time; +- sprintf(tbuf, "%ld", t); ++#if defined(PRINTF_HAS_LLD) ++ sprintf(tbuf, "%lld", (long long)t); ++#else ++ sprintf(tbuf, "%ld", (long)t); ++#endif + if (sch->flags & SCHEDFLAG_TRASH_ZLE) + flagstr = "-o"; + else -- jca | PGP : 0x1524E7EE / 5135 92C1 AD36 5293 2BDF DDCC 0DFA 74AE 1524 E7EE
