Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10 Apollo 4/10/84; site apollo.uucp Path: utzoo!watmath!clyde!akgua!mcnc!decvax!wivax!apollo!rees From: rees@apollo.UUCP Newsgroups: net.news.b Subject: Re: assorted 2.10.1 bug fixes and changes Message-ID: <1f49d991.1147@apollo.uucp> Date: Fri, 11-May-84 12:29:50 EDT Article-I.D.: apollo.1f49d991.1147 Posted: Fri May 11 12:29:50 1984 Date-Received: Sun, 13-May-84 07:14:03 EDT References: <1889@utcsstat.UUCP> Organization: Apollo Computer, Chelmsford, Mass. Lines: 118 The trouble with Geoff's fix to readr() is that it now prompts you on the last article even if you have one of the non-interactive flags on (like -e, my favorite flag). Of course the original code wasn't right either. It seems to me that you want to either do the interactive stuff, in the inner for() loop, or the non-interactive stuff. Here is my version of readr(). I tested the simple cases but can't claim to fully understand this code even now. readr() { int gotart; #ifdef DEBUG fprintf(stderr, "readr()\n"); #endif if (aflag) { if (*datebuf) { if ((atime = cgtdate(datebuf)) == -1) xerror("Cannot parse date string"); } else atime = 0L; } if (pflag && ignoring()) ignorenews = TRUE; if (uflag) time(&timelastsaved); ofp = stdout; if (cflag && coptbuf[0] != '\0') { umask(022); mktemp(outfile); /* get "unique" file name */ ofp = xfopen(outfile, "w"); umask(N_UMASK); cflag = FALSE; pflag = TRUE; } /* loop reading articles. */ fp = NULL; obit = -1; nextng(); for ( ;; ) { gotart = !getnextart(FALSE); if (!news) break; #ifdef DEBUG printf("after getnextart, fp %x, pos %ld, bit %d, group '%s', filename '%s'\n", fp, ftell(fp), bit, groupdir, filename); #endif if (gotart) strcpy(goodone, filename); if (pflag || lflag || eflag) { /* This code should be gotten rid of */ if (sigtrap) { qfflush(ofp); fprintf(ofp, "\n"); cdump(ofp); _exit(0); /* kludge! drop when qfflush works */ return; } if (gotart) { clear(bit); nextbit(); } else break; if (fp) { fclose(fp); fp = NULL; } continue; } for (; ; ) { char *pp; #ifdef SIGCONT int (*ocont)(); #endif sigtrap = FALSE; if (!cflag) { if (rfq) fprintf(ofp, "Last article. [qfr] "); else fprintf(ofp, "(%d lines) More? [ynq] ", NLINES(h, fp)); } else fprintf(ofp, "? "); fflush(ofp); bptr = lbuf; #ifdef SIGCONT ocont = signal(SIGCONT, catchcont); #endif pp = fgets(bptr, BUFLEN, stdin); #ifdef SIGCONT signal(SIGCONT, ocont); #endif if (pp != NULL) break; if (!sigtrap) return; #ifdef SIGCONT if (sigtrap != SIGCONT) #endif fprintf(ofp, "\n"); } nstrip(bptr); while (*bptr == ' ' || *bptr == '\t') bptr++; i = command(); if (i) break; } if (!news) fprintf(stderr, "No news.\n"); cout(ofp); }