Software Package:       
	inn

Release/Version:
	INN1.4-sec

Retrieved from:
	ftp.uu.net:news/nntp/inn/inn.tar.Z

Bug reports:
	This software package is maintained by the software contributor,
	not BSDI.  Please send any bug reports to both support@BSDI.COM
	and rsalz@uunet.uu.net.

Comments:
	This version was created by taking the INN distribution,
	configuring it with the config.data file (now in the grot/config
	directory), and running the substitution scripts.

	Once all the substitutions are done, you can munge around all the
	structure and Makefiles.   If you move anything, don't forget to
	change the appropriate definitions in ../Makefile.inc and
	samples/Makefile.

	Jeff Polk <polk@BSDI.COM>	12/16/94

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Modifications to this version made by BSDI:

The following change fixes a bug in the inn parsedate parsing
of dates.  Bug example is that "convdate '23:00:00 08/15/95'"
outputs "Tue Aug 15 22:00:00 1995".

Keith Bostic 07/27/95

===================================================================
RCS file: /master/contrib/news/inn/lib/parsedate.y,v
retrieving revision 1.1.1.1
diff -c -r1.1.1.1 parsedate.y
*** 1.1.1.1	1994/12/17 03:22:12
--- parsedate.y	1995/07/27 17:42:43
***************
*** 449,479 ****
  
  
  static time_t
- ToSeconds(Hours, Minutes, Seconds, Meridian)
-     time_t	Hours;
-     time_t	Minutes;
-     time_t	Seconds;
-     MERIDIAN	Meridian;
- {
-     if (Minutes < 0 || Minutes > 59 || Seconds < 0 || Seconds > 61)
- 	return -1;
-     if (Meridian == MER24) {
- 	if (Hours < 0 || Hours > 23)
- 	    return -1;
-     }
-     else {
- 	if (Hours < 1 || Hours > 12)
- 	    return -1;
- 	if (Hours == 12)
- 	    Hours = 0;
- 	if (Meridian == MERpm)
- 	    Hours += 12;
-     }
-     return (Hours * 60L + Minutes) * 60L + Seconds;
- }
- 
- 
- static time_t
  Convert(Month, Day, Year, Hours, Minutes, Seconds, Meridian, dst)
      time_t	Month;
      time_t	Day;
--- 449,454 ----
***************
*** 484,537 ****
      MERIDIAN	Meridian;
      DSTMODE	dst;
  {
!     static int	DaysNormal[13] = {
! 	0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31
!     };
!     static int	DaysLeap[13] = {
! 	0, 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31
!     };
!     static int	LeapYears[] = {
! 	1972, 1976, 1980, 1984, 1988, 1992, 1996,
! 	2000, 2004, 2008, 2012, 2016, 2020, 2024, 2028, 2032, 2036
!     };
!     register int	*yp;
!     register int	*mp;
!     register time_t	Julian;
!     register int	i;
!     time_t		tod;
  
!     if (Year < 0)
! 	Year = -Year;
!     if (Year < 100)
! 	Year += 1900;
!     if (Year < EPOCH)
! 	Year += 100;
!     for (mp = DaysNormal, yp = LeapYears; yp < ENDOF(LeapYears); yp++)
! 	if (Year == *yp) {
! 	    mp = DaysLeap;
! 	    break;
  	}
!     if (Year < EPOCH || Year > END_OF_TIME
!      || Month < 1 || Month > 12
!      /* NOSTRICT *//* conversion from long may lose accuracy */
!      || Day < 1 || Day > mp[(int)Month])
! 	return -1;
! 
!     Julian = Day - 1 + (Year - EPOCH) * 365;
!     for (yp = LeapYears; yp < ENDOF(LeapYears); yp++, Julian++)
! 	if (Year <= *yp)
! 	    break;
!     for (i = 1; i < Month; i++)
! 	Julian += *++mp;
!     Julian *= SECSPERDAY;
!     Julian += yyTimezone * 60L;
!     if ((tod = ToSeconds(Hours, Minutes, Seconds, Meridian)) < 0)
! 	return -1;
!     Julian += tod;
!     tod = Julian;
!     if (dst == DSTon || (dst == DSTmaybe && localtime(&tod)->tm_isdst))
! 	Julian -= DST_OFFSET * 60 * 60;
!     return Julian;
  }
  
  
--- 459,482 ----
      MERIDIAN	Meridian;
      DSTMODE	dst;
  {
! 	struct tm t;
  
! 	t.tm_sec = Seconds;
! 	t.tm_min = Minutes;
! 	if (Meridian != MER24) {
! 		if (Hours == 12)
! 			Hours = 0;
! 		if (Meridian == MERpm)
! 			Hours += 12;
  	}
! 	t.tm_hour = Hours;
! 	t.tm_mday = Day;
! 	t.tm_mon = Month - 1;
! 	t.tm_year = Year;
! 	t.tm_isdst = -1;
! 	t.tm_zone = NULL;
! 	t.tm_gmtoff = yyTimezone * 60L;
! 	return (mktime(&t));
  }
  
  
