Bug 426

Summary: at-3.17: 12am bug
Product: [Retired] Red Hat Linux Reporter: dkindred=redhat
Component: atAssignee: Cristian Gafton <gafton>
Status: CLOSED CURRENTRELEASE QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: 5.2   
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 1999-03-18 20:59:28 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description dkindred=redhat 1998-12-15 07:10:59 UTC
Version 3.17 of 'at' doesn't handle 12:00am-12:59am time
specifications correctly:

   % at -f /tmp/blah 12:30am; atq; atrm 6;
   warning: commands will be executed using /bin/sh
   job 6 at 1998-12-15 12:30
   6       1998-12-15 12:30 a

(Notice that the job is scheduled for 12:30pm.)
The patch below fixes this.

--- parsetime.y.orig    Tue May 13 08:46:16 1997
+++ parsetime.y Tue Dec 15 01:53:11 1998
@@ -181,6 +181,15 @@
                ;

 am_pm          : AM
+                   {
+                       if (exectm.tm_hour > 12) {
+                           yyerror("Hour too large for
AM");
+                           YYERROR;
+                       }
+                        else if (exectm.tm_hour == 12) {
+                            exectm.tm_hour -=12;
+                        }
+                   }
                | PM
                    {
                        if (exectm.tm_hour > 12) {

Comment 1 dkindred=redhat 1998-12-15 07:14:59 UTC
(Note that the yyerror line in the patch wrapped.)

Comment 2 Cristian Gafton 1999-03-18 20:59:59 UTC
Fixed in the current beta