diff options
author | 2008-06-09 22:31:24 +0000 | |
---|---|---|
committer | 2008-06-09 22:31:24 +0000 | |
commit | 09d285070149d577da93c686593c5718d71cf760 (patch) | |
tree | a5eeaf62f9569bedfa06c460cec16dcbaea23cb0 /usr.bin/cvs/entries.c | |
parent | Remove nmeaattch(8), which is superseeded by ldattach(8). (diff) | |
download | wireguard-openbsd-09d285070149d577da93c686593c5718d71cf760.tar.xz wireguard-openbsd-09d285070149d577da93c686593c5718d71cf760.zip |
Properly handle merged files and conflicts which may arrise while merge.
Instead of ignoring all files which contain possible conflict markers,
only watch out for files which have actually been merged.
With input by and ok joris.
Diffstat (limited to 'usr.bin/cvs/entries.c')
-rw-r--r-- | usr.bin/cvs/entries.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/usr.bin/cvs/entries.c b/usr.bin/cvs/entries.c index 331c0cbe885..6ea873fa539 100644 --- a/usr.bin/cvs/entries.c +++ b/usr.bin/cvs/entries.c @@ -1,4 +1,4 @@ -/* $OpenBSD: entries.c,v 1.95 2008/03/01 21:29:36 deraadt Exp $ */ +/* $OpenBSD: entries.c,v 1.96 2008/06/09 22:31:24 tobias Exp $ */ /* * Copyright (c) 2006 Joris Vink <joris@openbsd.org> * @@ -109,7 +109,7 @@ cvs_ent_parse(const char *entry) int i; struct tm t, dt; struct cvs_ent *ent; - char *fields[CVS_ENTRIES_NFIELDS], *buf, *sp, *dp; + char *fields[CVS_ENTRIES_NFIELDS], *buf, *sp, *dp, *p; buf = sp = xstrdup(entry); i = 0; @@ -156,16 +156,20 @@ cvs_ent_parse(const char *entry) if (fields[3][0] == '\0' || strncmp(fields[3], CVS_DATE_DUMMY, sizeof(CVS_DATE_DUMMY) - 1) == 0 || strncmp(fields[3], "Initial ", 8) == 0 || - strncmp(fields[3], "Result of merge", 15) == 0) { + strcmp(fields[3], "Result of merge") == 0) { ent->ce_mtime = CVS_DATE_DMSEC; } else if (cvs_server_active == 1 && strncmp(fields[3], CVS_SERVER_UNCHANGED, strlen(CVS_SERVER_UNCHANGED)) == 0) { ent->ce_mtime = CVS_SERVER_UPTODATE; } else { + p = fields[3]; + if (strncmp(fields[3], "Result of merge+", 16) == 0) + p += 16; + /* Date field can be a '+=' with remote to indicate * conflict. In this case do nothing. */ - if (strptime(fields[3], "%a %b %d %T %Y", &t) != NULL) { + if (strptime(p, "%a %b %d %T %Y", &t) != NULL) { t.tm_isdst = -1; /* Figure out DST. */ t.tm_gmtoff = 0; |