=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/cvs/entries.c,v retrieving revision 1.71 retrieving revision 1.72 diff -c -r1.71 -r1.72 *** src/usr.bin/cvs/entries.c 2007/01/27 18:53:16 1.71 --- src/usr.bin/cvs/entries.c 2007/02/04 06:09:31 1.72 *************** *** 1,4 **** ! /* $OpenBSD: entries.c,v 1.71 2007/01/27 18:53:16 otto Exp $ */ /* * Copyright (c) 2006 Joris Vink * --- 1,4 ---- ! /* $OpenBSD: entries.c,v 1.72 2007/02/04 06:09:31 joris Exp $ */ /* * Copyright (c) 2006 Joris Vink * *************** *** 115,122 **** struct cvs_ent *ent; char *fields[CVS_ENTRIES_NFIELDS], *buf, *sp, *dp; ! buf = xstrdup(entry); ! sp = buf; i = 0; do { dp = strchr(sp, CVS_ENTRIES_DELIM); --- 115,121 ---- struct cvs_ent *ent; char *fields[CVS_ENTRIES_NFIELDS], *buf, *sp, *dp; ! buf = sp = xstrdup(entry); i = 0; do { dp = strchr(sp, CVS_ENTRIES_DELIM); *************** *** 129,135 **** if (i < CVS_ENTRIES_NFIELDS) fatal("missing fields in entry line '%s'", entry); ! ent = (struct cvs_ent *)xmalloc(sizeof(*ent)); ent->ce_buf = buf; if (*fields[0] == '\0') --- 128,134 ---- if (i < CVS_ENTRIES_NFIELDS) fatal("missing fields in entry line '%s'", entry); ! ent = xmalloc(sizeof(*ent)); ent->ce_buf = buf; if (*fields[0] == '\0') *************** *** 156,167 **** if ((ent->ce_rev = rcsnum_parse(sp)) == NULL) fatal("failed to parse entry revision '%s'", entry); ! if (strcmp(fields[3], CVS_DATE_DUMMY) == 0 || strncmp(fields[3], "Initial ", 8) == 0 || strncmp(fields[3], "Result of merge", 15) == 0) ent->ce_mtime = CVS_DATE_DMSEC; else { ! strptime(fields[3], "%a %b %d %T %Y", &t); t.tm_isdst = 0; t.tm_gmtoff = 0; ent->ce_mtime = mktime(&t); --- 155,168 ---- if ((ent->ce_rev = rcsnum_parse(sp)) == NULL) fatal("failed to parse entry revision '%s'", entry); ! if (fields[3][0] == '\0' || ! strcmp(fields[3], CVS_DATE_DUMMY) == 0 || strncmp(fields[3], "Initial ", 8) == 0 || strncmp(fields[3], "Result of merge", 15) == 0) ent->ce_mtime = CVS_DATE_DMSEC; else { ! if (strptime(fields[3], "%a %b %d %T %Y", &t) == NULL) ! fatal("'%s' is not a valid date", fields[3]); t.tm_isdst = 0; t.tm_gmtoff = 0; ent->ce_mtime = mktime(&t);