getdate.y (aaa28628a3e4f66d9642eb4b6e6c49b5b61d4dce) getdate.y (4a0b57b0b4cbf7eb848927cf3f493163c3e76142)
1%{
2/*
3** Originally written by Steven M. Bellovin <smb@research.att.com> while
4** at the University of North Carolina at Chapel Hill. Later tweaked by
5** a couple of people on Usenet. Completely overhauled by Rich $alz
6** <rsalz@bbn.com> and Jim Berets <jberets@bbn.com> in August, 1990;
7**
8** This grammar has 10 shift/reduce conflicts.

--- 804 unchanged lines hidden (view full) ---

813 }
814}
815
816#define TM_YEAR_ORIGIN 1900
817
818time_t
819get_date(char *p)
820{
1%{
2/*
3** Originally written by Steven M. Bellovin <smb@research.att.com> while
4** at the University of North Carolina at Chapel Hill. Later tweaked by
5** a couple of people on Usenet. Completely overhauled by Rich $alz
6** <rsalz@bbn.com> and Jim Berets <jberets@bbn.com> in August, 1990;
7**
8** This grammar has 10 shift/reduce conflicts.

--- 804 unchanged lines hidden (view full) ---

813 }
814}
815
816#define TM_YEAR_ORIGIN 1900
817
818time_t
819get_date(char *p)
820{
821 struct tm *tm, gmt;
821 struct tm *tm;
822 time_t Start;
823 time_t tod;
824 time_t nowtime;
822 time_t Start;
823 time_t tod;
824 time_t nowtime;
825 struct tm *gmt_ptr;
826
827 yyInput = p;
828
829 (void)time (&nowtime);
830
825
826 yyInput = p;
827
828 (void)time (&nowtime);
829
831 gmt_ptr = gmtime (&nowtime);
832 if (gmt_ptr != NULL)
833 {
834 /* Make a copy, in case localtime modifies *tm (I think
835 that comment now applies to *gmt_ptr, but I am too
836 lazy to dig into how gmtime and locatime allocate the
837 structures they return pointers to). */
838 gmt = *gmt_ptr;
839 }
840
841 if (! (tm = localtime (&nowtime)))
842 return -1;
843
830 if (! (tm = localtime (&nowtime)))
831 return -1;
832
844 tm = localtime(&nowtime);
845 yyYear = tm->tm_year + 1900;
846 yyMonth = tm->tm_mon + 1;
847 yyDay = tm->tm_mday;
848 yyTimezone = tm->tm_gmtoff;
849 yyDSTmode = DSTmaybe;
850 yyHour = 0;
851 yyMinutes = 0;
852 yySeconds = 0;

--- 37 unchanged lines hidden ---
833 yyYear = tm->tm_year + 1900;
834 yyMonth = tm->tm_mon + 1;
835 yyDay = tm->tm_mday;
836 yyTimezone = tm->tm_gmtoff;
837 yyDSTmode = DSTmaybe;
838 yyHour = 0;
839 yyMinutes = 0;
840 yySeconds = 0;

--- 37 unchanged lines hidden ---