[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.16 and 1.17

version 1.16, 2001/09/27 02:55:01 version 1.17, 2001/09/27 18:19:20
Line 89 
Line 89 
         FILE *fp;          FILE *fp;
         int ch, l, i, bodun = 0, bodun_maybe = 0;          int ch, l, i, bodun = 0, bodun_maybe = 0;
         int var;          int var;
         char buf[2048 + 1];          char buf[2048 + 1], *prefix = NULL;
         struct event *events, *cur_evt, *ev1, *tmp;          struct event *events, *cur_evt, *ev1, *tmp;
         struct match *m;          struct match *m;
   
Line 114 
Line 114 
                             !strcmp(buf + 5, "uk_UA.KOI8-U") ||                              !strcmp(buf + 5, "uk_UA.KOI8-U") ||
                             !strcmp(buf + 5, "by_BY.KOI8-B")) {                              !strcmp(buf + 5, "by_BY.KOI8-B")) {
                                 bodun_maybe++;                                  bodun_maybe++;
                                 bodun = bodun_always;                                  bodun = 0;
                                   if (prefix)
                                           free(prefix);
                                   prefix = NULL;
                         } else                          } else
                                 bodun_maybe = 0;                                  bodun_maybe = 0;
                         continue;                          continue;
                 }                  }
                 if (bodun_maybe && strncmp(buf, "BODUN=", 6) == 0)                  if (bodun_maybe && strncmp(buf, "BODUN=", 6) == 0) {
                         bodun++;                          bodun++;
                           if (prefix)
                                   free(prefix);
                           if ((prefix = strdup(buf + 6)) == NULL)
                                   err(1, NULL);
                   }
                 /* User defined names for special events */                  /* User defined names for special events */
                 if ((p = strchr(buf, '='))) {                  if ((p = strchr(buf, '='))) {
                         for (i = 0; i < NUMEV; i++) {                          for (i = 0; i < NUMEV; i++) {
Line 167 
Line 175 
                                         cur_evt->desc = ev1->desc;                                          cur_evt->desc = ev1->desc;
                                         cur_evt->ldesc = NULL;                                          cur_evt->ldesc = NULL;
                                 } else {                                  } else {
                                         if (m->prefix[0]) {                                          if (m->bodun && prefix) {
                                                 int l1 = strlen(m->prefix);                                                  int l1 = strlen(prefix);
                                                 int l2 = strlen(p);                                                  int l2 = strlen(p);
                                                 if ((cur_evt->ldesc =                                                  if ((cur_evt->ldesc =
                                                     malloc(l1 + l2)) == NULL)                                                      malloc(l1 + l2)) == NULL)
                                                         err(1, "realloc");                                                          err(1, "malloc");
                                                 sprintf(cur_evt->ldesc, "\t%s%s",                                                  sprintf(cur_evt->ldesc,
                                                     m->prefix, p + 1);                                                      "\t%s %s", prefix, p + 1);
                                         } else if ((cur_evt->ldesc =                                          } else if ((cur_evt->ldesc =
                                             strdup(p)) == NULL)                                              strdup(p)) == NULL)
                                                 err(1, NULL);                                                  err(1, NULL);

Legend:
Removed from v.1.16  
changed lines
  Added in v.1.17