gam@amdahl.UUCP (08/20/87)
John Gilmore pointed out to me that the name SIGCHARS and SIGLINES violate the ANSII C standard for reserved names (those that start with 'SIG'). I have changed the patch to use 'S' in place of 'SIG'; thus, 'SCHARS' and 'SLINES'. Also I have promised to go read the ANSI C standard. Functionally there is no changes from the original patch, just name changes. The original patch article has been cancelled. *** OLDinews.c Fri Jun 5 17:57:04 1987 --- inews.c Fri Jun 5 17:57:04 1987 *************** *** 46,52 **** #define CONTROL 0010 /* Control Message */ #define CREATENG 0020 /* Create a new newsgroup */ ! #define SLINES 4 /* .signature files > this many lines are not included */ char forgedname[NAMELEN]; /* A user specified -f option. */ int spool_news = FALSE; --- 46,52 ---- #define CONTROL 0010 /* Control Message */ #define CREATENG 0020 /* Create a new newsgroup */ ! #undef SCHARS 512 /* .signature files > this many chars are not included */ char forgedname[NAMELEN]; /* A user specified -f option. */ int spool_news = FALSE; *************** *** 948,959 **** } if (*filename) (void) fclose(infp); if (mode != PROC && linserted > (linecount-linserted)) error("Article rejected: %s included more text than new text", username); if (mode != PROC && !is_ctl && header.sender[0] == '\0') { ! int siglines = 0; char sbuf[BUFLEN]; (void) sprintf(bfr, "%s/%s", userhome, ".signature"); if (access(bfr, 4) == 0) { --- 948,961 ---- } if (*filename) (void) fclose(infp); + #ifdef INSERTLIMIT if (mode != PROC && linserted > (linecount-linserted)) error("Article rejected: %s included more text than new text", username); + #endif INSERTLIMIT if (mode != PROC && !is_ctl && header.sender[0] == '\0') { ! int sigchars = 0; char sbuf[BUFLEN]; (void) sprintf(bfr, "%s/%s", userhome, ".signature"); if (access(bfr, 4) == 0) { *************** *** 963,974 **** goto finish; } ! while (fgets(sbuf, sizeof sbuf, infp) != NULL) ! if (++siglines > SLINES) break; ! if (siglines > SLINES) ! fprintf(stderr,".signature not included (> %d lines)\n", SLINES); ! else { rewind(infp); fprintf(tmpfp, "-- \n"); /* To separate */ linecount++; --- 965,979 ---- goto finish; } ! #ifdef SCHARS ! while (getc(infp) != EOF) ! if (++sigchars > SCHARS) break; ! if (sigchars > SCHARS) ! fprintf(stderr, ".signature not included (> %d chars)\n", SCHARS); ! else ! #endif SCHARS ! { rewind(infp); fprintf(tmpfp, "-- \n"); /* To separate */ linecount++; -- Gordon A. Moffett gam@amdahl.amdahl.com "a clever quote"