war on BSD style curly braces
[citadel.git] / citadel / parsedate.y
index b710129c04f9434a3fc909924458502358e8ad6f..d6022d365d3d22965b2411e8a4939c2a1ee56e7c 100644 (file)
@@ -7,7 +7,7 @@
 **  <rsalz@osf.org> and Jim Berets <jberets@bbn.com> in August, 1990.
 **  Further revised (removed obsolete constructs and cleaned up timezone
 **  names) in August, 1991, by Rich.  Paul Eggert <eggert@twinsun.com>
-**  helped in September, 1992.  Art Cancro <ajc@uncensored.citadel.org> cleaned
+**  helped in September, 1992.  Art Cancro <ajc@citadel.org> cleaned
 **  it up for ANSI C in December, 1999.
 **
 **  This grammar has six shift/reduce conflicts.
 /* SUPPRESS 593 on yyerrlab *//* Label was not used */
 /* SUPPRESS 593 on yynewstate *//* Label was not used */
 /* SUPPRESS 595 on yypvt *//* Automatic variable may be used before set */
+
+#include "sysdep.h"
+
 #include <stdio.h>
 #include <stdlib.h>
 #include <sys/types.h>
 #include <ctype.h>
-
-#if TIME_WITH_SYS_TIME
-# include <sys/time.h>
-# include <time.h>
-#else
-# if HAVE_SYS_TIME_H
-#  include <sys/time.h>
-# else
-#  include <time.h>
+#include <time.h>
+#if HAVE_STRING_H
+# if !STDC_HEADERS && HAVE_MEMORY_H
+#  include <memory.h>
 # endif
+# include <string.h>
+#endif
+#if HAVE_STRINGS_H
+# include <strings.h>
 #endif
 
 #include "parsedate.h"
@@ -89,7 +91,7 @@ typedef enum _MERIDIAN {
 **  union, but this is more efficient.  (This routine predates the
 **  yacc %union construct.)
 */
-static char    *yyInput;
+static const char      *yyInput;
 static DSTMODE yyDSTmode;
 static int     yyHaveDate;
 static int     yyHaveRel;
@@ -717,12 +719,12 @@ date_lex(void)
 
 
 time_t
-parsedate(char *p)
+parsedate(const char *p)
 {
     extern int         date_parse(void);
     time_t             Start;
 
-    yyInput = p;
+    yyInput = p; /* well, its supposed to be const... */
 
     yyYear = 0;
     yyMonth = 0;
@@ -782,7 +784,7 @@ main(int ac, char *av[])
     for ( ; ; ) {
        (void)printf("\t> ");
        (void)fflush(stdout);
-       if (gets(buff) == NULL || buff[0] == '\n')
+       if (fgets(buff, sizeof buff, stdin) == NULL || buff[0] == '\n')
            break;
 #if YYDEBUG
        if (strcmp(buff, "yydebug") == 0) {