From fdf773bec37e1b71078dc4e1aac1657add9223e5 Mon Sep 17 00:00:00 2001 From: Taylor R Campbell Date: Mon, 14 Feb 2011 17:39:45 +0000 Subject: [PATCH] Fix ENCODE-TIME to correctly handle negative time zones. This bug has been lying here for fifteen years. Obviously we need more MIT Scheme hackers in the western hemisphere... All this time and date code desperately needs a lot of automatic tests, too. --- src/microcode/prosenv.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/microcode/prosenv.c b/src/microcode/prosenv.c index 72f9a1304..5de256ec8 100644 --- a/src/microcode/prosenv.c +++ b/src/microcode/prosenv.c @@ -116,8 +116,8 @@ DEFINE_PRIMITIVE ("ENCODE-TIME", Prim_encode_time, 1, 1, (ts . time_zone) = (((len > 9) && (INTEGER_P (VECTOR_REF (vec, 9))) - && (integer_to_ulong_p (VECTOR_REF (vec, 9)))) - ? (integer_to_ulong (VECTOR_REF (vec, 9))) + && (integer_to_long_p (VECTOR_REF (vec, 9)))) + ? (integer_to_long (VECTOR_REF (vec, 9))) : INT_MAX); PRIMITIVE_RETURN (intmax_to_integer (OS_encode_time (&ts))); } -- 2.25.1