rees@apollo.uucp (Jim Rees) (08/12/87)
Here are the mods to add the "Supersedes:" header to your news 2.11 software. It seems like a good idea to me. Note that there doesn't seem to be a consensus yet on whether to implement this or not, but if you decide you want to, here it is. This assumes news 2.11, patch level 8, as a base. As usual, your line numbers may vary. *** header.h.08.12 Wed Feb 25 15:59:04 1987 --- header.h Wed Aug 12 09:37:08 1987 *************** *** 30,35 char approved[BUFLEN]; /* Approved: */ char nf_id[BUFLEN]; /* Nf-ID: */ char nf_from[BUFLEN]; /* Nf-From: */ #ifdef DOXREFS char xref[BUFLEN]; /* Xref: */ #endif /* DOXREFS */ --- 30,36 ----- char approved[BUFLEN]; /* Approved: */ char nf_id[BUFLEN]; /* Nf-ID: */ char nf_from[BUFLEN]; /* Nf-From: */ + char supersedes[BUFLEN]; /* Supersedes: */ #ifdef DOXREFS char xref[BUFLEN]; /* Xref: */ #endif /* DOXREFS */ *** header.c.08.12 Thu Mar 26 13:18:37 1987 --- header.c Wed Aug 12 09:40:23 1987 *************** *** 147,152 #define XREF 24 #define SUMMARY 25 #define XPATH 26 #define OTHER 99 char *malloc(); --- 147,153 ----- #define XREF 24 #define SUMMARY 25 #define XPATH 26 + #define SUPERSEDES 27 #define OTHER 99 char *malloc(); *************** *** 240,245 case NFFROM: getfield(hp->nf_from, sizeof(hp->nf_from)); break; /* discard these lines */ case XREF: case XPATH: --- 241,249 ----- case NFFROM: getfield(hp->nf_from, sizeof(hp->nf_from)); break; + case SUPERSEDES: + getfield(hp->supersedes, sizeof(hp->supersedes)); + break; /* discard these lines */ case XREF: case XPATH: *************** *** 605,610 return XREF; if (its("Xpath: ")) return XPATH; if (!isalpha(*ptr)) return FALSE; colon = index(ptr, ':'); --- 609,616 ----- return XREF; if (its("Xpath: ")) return XPATH; + if (its("Supersedes: ")) + return SUPERSEDES; if (!isalpha(*ptr)) return FALSE; colon = index(ptr, ':'); *************** *** 689,694 fprintf(fp, "Nf-ID: %s\n", hp->nf_id); if (*hp->nf_from) fprintf(fp, "Nf-From: %s\n", hp->nf_from); #ifdef DOXREFS if ( wr ==1 && *hp->xref) fprintf(fp, "Xref: %s\n", hp->xref); --- 695,702 ----- fprintf(fp, "Nf-ID: %s\n", hp->nf_id); if (*hp->nf_from) fprintf(fp, "Nf-From: %s\n", hp->nf_from); + if (*hp->supersedes) + fprintf(fp, "Supersedes: %s\n", hp->supersedes); #ifdef DOXREFS if ( wr ==1 && *hp->xref) fprintf(fp, "Xref: %s\n", hp->xref); *** /news/2.11/src/inews.c Tue Apr 14 10:36:26 1987 --- inews.c Wed Aug 12 10:35:17 1987 *************** *** 1031,1036 (void) signal(SIGTTOU, SIG_IGN); #endif /* SIGTTOU */ savehist(histline); broadcast(mode==PROC); } xxit((mode == PROC && filename[0] == '\0') ? 0 : --- 1031,1043 ----- (void) signal(SIGTTOU, SIG_IGN); #endif /* SIGTTOU */ savehist(histline); + if (header.supersedes[0] != '\0') { + char *av[2]; + + av[0] = "cancel"; + av[1] = header.supersedes; + c_cancel(2, av); + } broadcast(mode==PROC); } xxit((mode == PROC && filename[0] == '\0') ? 0 :