From debbugs-submit-bounces@debbugs.gnu.org Mon Jul 18 12:43:46 2022 Received: (at submit) by debbugs.gnu.org; 18 Jul 2022 16:43:46 +0000 Received: from localhost ([127.0.0.1]:51929 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oDTqR-0002P0-Pz for submit@debbugs.gnu.org; Mon, 18 Jul 2022 12:43:46 -0400 Received: from lists.gnu.org ([209.51.188.17]:36732) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oDTlC-0002Gm-C6 for submit@debbugs.gnu.org; Mon, 18 Jul 2022 12:38:33 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:33766) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oDTlC-0003NQ-6B for bug-guile@gnu.org; Mon, 18 Jul 2022 12:38:18 -0400 Received: from mail.nborghese.com ([2001:19f0:5:48e0:5400:4ff:fe08:e8a8]:38362) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oDTky-00037C-Qy for bug-guile@gnu.org; Mon, 18 Jul 2022 12:38:17 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; s=062122; bh=V+G/oPf/lt2qN 6jbg8q0U1QvlR/PLMdq5Ff48NTMbmo=; h=date:subject:to:from; d=nborghese.com; b=iV1bfvQwMDs06qh2f5bbMWpyDlUQ6Gw7P/C87wVIyoh3CQ3HVtt P+8qnMSAGqDn1E9QUjDftrZopbZffnVCNXNiBO2GHb7IO5kWSIyLw+WAOKfrafgleNhh83 Il2K7ySdGWlyS1QGNbraiR3VB7CAcyf97Srm6taZ6VZWAe+Q4A= Received: by nborghese.com (OpenSMTPD) with ESMTPSA id a1a157d4 (TLSv1.3:AEAD-AES256-GCM-SHA384:256:NO) for ; Mon, 18 Jul 2022 16:38:10 +0000 (UTC) User-agent: mu4e 1.6.11; emacs 28.1 From: Nathan Borghese To: bug-guile@gnu.org Subject: [PATCH] srfi-19: fix 12AM in ~I and ~l Date: Mon, 18 Jul 2022 00:04:18 -0400 Message-ID: <87zgh7awuh.fsf@nborghese.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Received-SPF: pass client-ip=2001:19f0:5:48e0:5400:4ff:fe08:e8a8; envelope-from=nathan@nborghese.com; helo=mail.nborghese.com X-Spam_score_int: -2 X-Spam_score: -0.3 X-Spam_bar: / X-Spam_report: (-0.3 / 5.0 requ) BAYES_00=-1.9, DATE_IN_PAST_12_24=1.049, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FROM_FMBLA_NEWDOM28=0.798, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01, T_SPF_HELO_TEMPERROR=0.01 autolearn=no autolearn_force=no X-Spam_action: no action X-Spam-Score: 2.5 (++) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: Fix 12AM showing up as 0. From e9e084a8047ca9d189d8d751173196d906a1758f Mon Sep 17 00:00:00 2001 From: Nathan Borghese Date: Mon, 18 Jul 2022 00:01:08 -0400 Subject: [PATCH] srfi-19: fix ~I and ~l Content analysis details: (2.5 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 SPF_HELO_PASS SPF: HELO matches SPF record 0.8 DATE_IN_PAST_12_24 Date: is 12 to 24 hours before Received: date 0.9 SPF_FAIL SPF: sender does not match SPF record (fail) [SPF failed: Please see http://www.openspf.org/Why?s=mfrom; id=nathan%40nborghese.com; ip=209.51.188.17; r=debbugs.gnu.org] 0.8 FROM_FMBLA_NEWDOM28 From domain was registered in last 14-28 days -0.0 T_SCC_BODY_TEXT_LINE No description available. X-Debbugs-Envelope-To: submit X-Mailman-Approved-At: Mon, 18 Jul 2022 12:43:42 -0400 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.8 (/) --=-=-= Content-Type: text/plain Fix 12AM showing up as 0. --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0001-srfi-19-fix-I-and-l.patch Content-Description: patch >From e9e084a8047ca9d189d8d751173196d906a1758f Mon Sep 17 00:00:00 2001 From: Nathan Borghese Date: Mon, 18 Jul 2022 00:01:08 -0400 Subject: [PATCH] srfi-19: fix ~I and ~l * module/srfi/srfi-19.scm (directives): fix 12AM in ~I and ~l --- module/srfi/srfi-19.scm | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/module/srfi/srfi-19.scm b/module/srfi/srfi-19.scm index 948a34eef..c14672e9e 100644 --- a/module/srfi/srfi-19.scm +++ b/module/srfi/srfi-19.scm @@ -983,13 +983,9 @@ port))) (cons #\I (lambda (date pad-with port) (let ((hr (date-hour date))) - (if (> hr 12) - (display (padding (- hr 12) - pad-with 2) - port) - (display (padding hr - pad-with 2) - port))))) + (display (padding (1+ (modulo (+ 11 (date-hour date)) 12)) + pad-with 2) + port)))) (cons #\j (lambda (date pad-with port) (display (padding (date-year-day date) pad-with 3) @@ -999,10 +995,9 @@ #\Space 2) port))) (cons #\l (lambda (date pad-with port) - (let ((hr (if (> (date-hour date) 12) - (- (date-hour date) 12) (date-hour date)))) - (display (padding hr #\Space 2) - port)))) + (display (padding (1+ (modulo (+ 11 (date-hour date)) 12)) + #\Space 2) + port))) (cons #\m (lambda (date pad-with port) (display (padding (date-month date) pad-with 2) -- 2.36.1 --=-=-=--