[BACK]Return to io.c CVS log [TXT][DIR] Up to [local] / src / usr.bin / calendar

Diff for /src/usr.bin/calendar/io.c between version 1.1 and 1.4

version 1.1, 1996/12/05 06:04:40 version 1.4, 1998/03/30 06:59:27
Line 62 
Line 62 
 #include <stdio.h>  #include <stdio.h>
 #include <stdlib.h>  #include <stdlib.h>
 #include <string.h>  #include <string.h>
   #include <tzfile.h>
 #include <unistd.h>  #include <unistd.h>
   
 #include "pathnames.h"  #include "pathnames.h"
Line 149 
Line 150 
                                 tm.tm_mon = month - 1;                                  tm.tm_mon = month - 1;
                                 tm.tm_mday = day;                                  tm.tm_mday = day;
                                 tm.tm_year = tp->tm_year; /* unused */                                  tm.tm_year = tp->tm_year; /* unused */
                                 (void)strftime(dbuf, sizeof(dbuf), "%c", &tm);                                  tm.tm_isdst = tp->tm_isdst; /* unused */
                                 dbuf[10] = '\0';                                  tm.tm_gmtoff = tp->tm_gmtoff; /* unused */
                                   tm.tm_zone = tp->tm_zone; /* unused */
                                   (void)strftime(dbuf, sizeof(dbuf), "%a %b %d",
                                       &tm);
                                 (void)fprintf(fp, "%s%c%s\n",                                  (void)fprintf(fp, "%s%c%s\n",
                                     dbuf + 4/* skip weekdays */,                                      dbuf + 4/* skip weekdays */,
                                     var ? '*' : ' ', p);                                      var ? '*' : ' ', p);
Line 214 
Line 218 
         }          }
   
         /* Easter */          /* Easter */
         else if ((val = geteaster(start, tp->tm_year + 1900)) != 0)          else if ((val = geteaster(start, tp->tm_year + TM_YEAR_BASE)) != 0)
             *flags |= F_EASTER;              *flags |= F_EASTER;
   
         /* Paskha */          /* Paskha */
         else if ((val = getpaskha(start, tp->tm_year + 1900)) != 0)          else if ((val = getpaskha(start, tp->tm_year + TM_YEAR_BASE)) != 0)
             *flags |= F_EASTER;              *flags |= F_EASTER;
   
         /* undefined rest */          /* undefined rest */
Line 253 
Line 257 
                         chdir(getenv("HOME"));                          chdir(getenv("HOME"));
                         if (!(chdir(calendarHome) == 0 &&                          if (!(chdir(calendarHome) == 0 &&
                               freopen(calendarFile, "r", stdin)))                                freopen(calendarFile, "r", stdin)))
                                 errx(1, "no calendar file: ``%s'' or ``~/%s/%s\n", calendarFile, calendarHome, calendarFile);                                  errx(1, "no calendar file: ``%s'' or ``~/%s/%s",
                                       calendarFile, calendarHome, calendarFile);
                 }                  }
         }          }
         if (pipe(pdes) < 0)          if (pipe(pdes) < 0)

Legend:
Removed from v.1.1  
changed lines
  Added in v.1.4