From f6ac6875d7f54aeaa14ef9e523c6ebdf5c0995be Mon Sep 17 00:00:00 2001 From: Poul-Henning Kamp Date: Sat, 15 Jan 2000 19:45:18 +0000 Subject: [PATCH] |Since I had suffered from partially applied CTM deltas, some time ago, |I made ctm ignore deltas for files that match the "after edit" MD5. |(In one case, I had the compiler fill all temporary space while CTM |was editing files.) Submitted by: se Reviewed by: phk --- usr.sbin/ctm/ctm/ctm_pass2.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/usr.sbin/ctm/ctm/ctm_pass2.c b/usr.sbin/ctm/ctm/ctm_pass2.c index ea298955646f..be4dbf284b2f 100644 --- a/usr.sbin/ctm/ctm/ctm_pass2.c +++ b/usr.sbin/ctm/ctm/ctm_pass2.c @@ -154,7 +154,12 @@ Pass2(FILE *fd) strcmp(tmp,p)) { fprintf(stderr," %s: %s md5 mismatch.\n", sp->Key,name); - if(j & CTM_Q_MD5_Force) { + GETFIELDCOPY(md5,sep); + if(md5 != NULL && strcmp(tmp,md5) == 0) { + fprintf(stderr," %s: %s already applied.\n", + sp->Key,name); + match = CTM_FILTER_DISABLE; + } else if(j & CTM_Q_MD5_Force) { if(Force) fprintf(stderr," Can and will force.\n"); else @@ -165,9 +170,10 @@ Pass2(FILE *fd) } } break; - } - if(j & CTM_Q_MD5_After) { - GETFIELDCOPY(md5,sep); + } else if(j & CTM_Q_MD5_After) { + if(md5 == NULL) { + GETFIELDCOPY(md5,sep); + } break; } /* Unqualified MD5 */