b04a39a028980ea32b2ac62950bdff0a67de16d0 galt Wed Jul 18 14:48:19 2018 -0700 Add missing CSP header to pages not handled automatically by library functions. refs #21729. diff --git src/hg/hgCert/hgCert.c src/hg/hgCert/hgCert.c index a6e42aa..184d720 100644 --- src/hg/hgCert/hgCert.c +++ src/hg/hgCert/hgCert.c @@ -1,223 +1,224 @@ /* hgCert - hgCert parses cerfification data file and generates an html file and a .tab file */ /* Copyright (C) 2011 The Regents of the University of California * See README in this or parent directory for licensing information. */ #include "common.h" #include "hCommon.h" +#include "htmshell.h" void usage() /* Explain usage and exit. */ { errAbort( "hgCert - hgCert parses cerfification data file and generates an html file and a .tab file\n" "usage: hgCert certificate.txt >certificate.html\n"); } char *doLine(char *lineType, char *lineIn) { char *result; char line[1000]; strcpy(line, lineIn); *(line+strlen(line) - 1) = '\0'; result = strstr(line, lineType); if (result == NULL) { return(result); } else { result = result + strlen(lineType); return(result); } } char *doLine2(char *lineIn, char *lineType) { char *chp; char line[1000]; strcpy(line, lineIn); *(line+strlen(line) - 1) = '\0'; chp = strstr(line, ":"); if (chp == NULL) return(strdup("???")); *chp = '\0'; chp ++; chp ++; chp = strdup(chp); strcpy(lineType, line); if (strcmp(chp, " ") == 0) chp = strdup(" "); return(chp); } int main(int argc, char *argv[]) { char *infileName; FILE *inf, *outf; char line[1000]; char *content; char *contact=""; char *join; char *join1, *join2; char *spanner, *variation, *variationEvidence, *comment, *evaluation, *remark; char lineType[100]; //int i,j; if (argc != 2) { usage(); } else { infileName = argv[1]; - fprintf(stdout, "
Accession 1 | \n"); fprintf(stdout, "Accession 2 | \n"); fprintf(stdout, "Spanner | \n"); fprintf(stdout, "Variation | \n"); fprintf(stdout, "Variation Evidence | \n"); fprintf(stdout, "Comment | \n"); fprintf(stdout, "Evaluation | \n"); fprintf(stdout, "Remark | \n"); fprintf(stdout, "Contact | \n"); fprintf(stdout, " \n"); outf = fopen("cert.tab", "w"); if ((inf = fopen(infileName, "r")) == NULL) { fprintf(stderr, "Can't open file %s.\n", infileName); exit(8); } while (fgets(line, 1000, inf) != NULL) { content = doLine("CONTACT: ", line); if (content != NULL) { contact = strdup(content); fgets(line, 1000, inf); fgets(line, 1000, inf); } join = doLine("JOIN: ", line); if (join != NULL) { join1 = join; join2 = strstr(join, " "); *join2 = '\0'; join2++; join1 = strdup(join1); join2 = strdup(join2); fgets(line, 1000, inf); } else { fprintf(stderr, "No JOIN!\n"); exit(1); } spanner=variation=variationEvidence=comment=evaluation = remark= strdup("  "); again: content = doLine2(line, lineType); if (strcmp(lineType, "VARIATION") == 0) { variation = content; } content = doLine2(line, lineType); if (strcmp(lineType, "SPANNER") == 0) { spanner = content; } content = doLine2(line, lineType); if (strcmp(lineType, "VARIATION EVIDENCE") == 0) { variationEvidence = content; } content = doLine2(line, lineType); if (strcmp(lineType, "REMARK") == 0) { remark = content; } content = doLine2(line, lineType); if (strcmp(lineType, "COMMENT") == 0) { comment = content; } content = doLine2(line, lineType); if (strcmp(lineType, "EVALUATION") == 0) { evaluation = content; } fgets(line, 1000, inf); if (strlen(line) > 3) { goto again; } else { printf("
---|---|---|---|---|---|---|---|---|
%s | ", join1); printf("%s | ", join2); printf("%s | ", spanner); printf("%s | ", variation); printf("%s | ", variationEvidence); printf("%s | ", comment); printf("%s | ", evaluation); printf("%s | ", remark); printf("%s | ", contact, contact); printf("