chuqui@nsc.UUCP (Chuq) (08/21/84)
Here are a couple of small changes to the 2.10.2 release of inews. 1) All references to the variable tty are from an old piece of code that was removed a while back and don't need to exist anymore. This makes the code a bit smaller, cleaner, and faster. 2) I removed the references to recordings. Please don't start the discussion of whether or not recordings belong in inews. If you don't agree with me, just don't make those changes. (for the record, recordings belong in postnews, readnews, and vnews, not inews. At least, as far as I'm concerned... Flames to /dev/null). chuq ------- inews.c ------- *** /tmp/d01999 Tue Aug 21 03:36:37 1984 --- inews.c Tue Aug 21 03:27:02 1984 *************** *** 242,256 * ALL of the command line has now been processed. (!) */ - tty = isatty(fileno(stdin)); - if (!Dflag && mode != PROC && mode != CREATENG) { - if (recording(header.nbuf)) { - if (!tty) - fwait(fsubr(newssave, stdin, NULL)); - xerror("aborted due to recording"); - } - } - /* This code is really intended to be replaced by the control message. */ if (mode == CANCEL) { char *p; FILE *f; --- 242,247 ----- * ALL of the command line has now been processed. (!) */ /* This code is really intended to be replaced by the control message. */ if (mode == CANCEL) { char *p; FILE *f; *************** *** 310,320 if (strcmp(header.oident, "id") == 0) header.oident[0] = '\0'; ngcat(header.nbuf); - if (recording(header.nbuf)) { - if (!tty) - fwait(fsubr(newssave, stdin, NULL)); - xerror("aborted due to recording"); - } } if (forgedname[0]) { strcpy(header.path, forgedname); --- 301,306 ----- if (strcmp(header.oident, "id") == 0) header.oident[0] = '\0'; ngcat(header.nbuf); } if (forgedname[0]) { strcpy(header.path, forgedname); *************** *** 694,705 int linecount = 0; tmpfp = xfopen(mktemp(INFILE), "w"); - if (*filename) { - tty = FALSE; - infp = xfopen(filename, "r"); - } else { - infp = stdin; - } while (!sigtrap && fgets(bfr, BUFLEN, stdin) != NULL) { if (mode == PROC) /* zap trailing empty lines */ { --- 680,685 ----- int linecount = 0; tmpfp = xfopen(mktemp(INFILE), "w"); while (!sigtrap && fgets(bfr, BUFLEN, stdin) != NULL) { if (mode == PROC) /* zap trailing empty lines */ { *************** *** 722,728 } #endif ZAPNOTES } ! if (mode != PROC && tty && strcmp(bfr, ".\n") == 0) break; for (cp = bfr; c = *cp; cp++) { if (isprint(c) || isspace(c) || c=='\b') --- 702,708 ----- } #endif ZAPNOTES } ! if (mode != PROC && strcmp(bfr, ".\n") == 0) break; for (cp = bfr; c = *cp; cp++) { if (isprint(c) || isspace(c) || c=='\b') *************** *** 751,762 fclose(tmpfp); if (sigtrap) { ! if (tty) ! printf("Interrupt\n"); ! if (tty && !empty) ! fwait(fsubr(newssave, (char *) NULL, (char *) NULL)); ! if (!tty) ! log("Blown away by an interrupt %d", sigtrap); xxit(1); } if (tty) --- 731,737 ----- fclose(tmpfp); if (sigtrap) { ! log("Blown away by an interrupt %d", sigtrap); xxit(1); } fflush(stdout); *************** *** 759,766 log("Blown away by an interrupt %d", sigtrap); xxit(1); } - if (tty) - printf("EOT\n"); fflush(stdout); infp = fopen(INFILE, "r"); if (chcount < 5 && mode <= UNPROC && !is_ctl) --- 734,739 ----- log("Blown away by an interrupt %d", sigtrap); xxit(1); } fflush(stdout); infp = fopen(INFILE, "r"); if (chcount < 5 && mode <= UNPROC && !is_ctl) ------- iextern.c ------- *** /tmp/d02004 Tue Aug 21 03:36:46 1984 --- iextern.c Tue Aug 21 03:28:05 1984 *************** *** 73,79 char nbuf[LBUFLEN]; /* local newsgroup buffer */ FILE *infp; /* input file-pointer */ FILE *actfp; /* active newsgroups file pointer */ - int tty; /* set if infp is a tty */ char *PARTIAL = "dead.article"; /* place to save partial news */ int flag = FALSE; /* set if at least one group O.K. */ char *SHELL = "/bin/sh"; /* shell for inews to use */ --- 73,78 ----- char nbuf[LBUFLEN]; /* local newsgroup buffer */ FILE *infp; /* input file-pointer */ FILE *actfp; /* active newsgroups file pointer */ char *PARTIAL = "dead.article"; /* place to save partial news */ int flag = FALSE; /* set if at least one group O.K. */ char *SHELL = "/bin/sh"; /* shell for inews to use */ ------- iparams.h ------- *** /tmp/d02006 Tue Aug 21 03:36:49 1984 --- iparams.h Tue Aug 21 03:28:47 1984 *************** *** 21,25 extern char logfname[], STASH[]; extern FILE *infp,*actfp; ! extern int tty, flag, is_ctl; extern char filename[],*DFLTNG,whatever[]; --- 21,25 ----- extern char logfname[], STASH[]; extern FILE *infp,*actfp; ! extern int flag, is_ctl; extern char filename[],*DFLTNG,whatever[]; -- From the depths of the Crystal Cavern: Chuq Von Rospach {amd,decwrl,fortune,hplabs,ihnp4}!nsc!chuqui nsc!chuqui@decwrl.ARPA Dreams, dreams, enchanter! Gone with the harp's echo when the strings fall mute; with the flame's shadow when the fire dies. Be still, and listen.