BSD 4_2 release
[unix-history] / usr / src / usr.bin / learn / learn.c
index 47e3492..c4fe9fb 100644 (file)
@@ -1,5 +1,5 @@
 #ifndef lint
 #ifndef lint
-static char sccsid[] = "@(#)learn.c    4.1     (Berkeley)      2/24/83";
+static char sccsid[] = "@(#)learn.c    4.2     (Berkeley)      4/27/83";
 #endif not lint
 
 #include "stdio.h"
 #endif not lint
 
 #include "stdio.h"
@@ -23,8 +23,13 @@ char *dir;
 FILE   *scrin;
 int    logging = 1;    /* set to 0 to turn off logging */
 int    ask;
 FILE   *scrin;
 int    logging = 1;    /* set to 0 to turn off logging */
 int    ask;
+int    again;
+int    skip;
+int    teed;
+int    total;
 
 main(argc,argv)
 
 main(argc,argv)
+int argc;
 char *argv[];
 {
        extern hangup(), intrpt();
 char *argv[];
 {
        extern hangup(), intrpt();
@@ -35,7 +40,9 @@ char *argv[];
        more = 1;
        pwline = getlogin();
        setbuf(stdout, malloc(BUFSIZ));
        more = 1;
        pwline = getlogin();
        setbuf(stdout, malloc(BUFSIZ));
+       setbuf(stderr, malloc(BUFSIZ));
        selsub(argc, argv);
        selsub(argc, argv);
+       chgenv();
        signal(SIGHUP, hangup);
        signal(SIGINT, intrpt);
        while (more) {
        signal(SIGHUP, hangup);
        signal(SIGINT, intrpt);
        while (more) {
@@ -62,7 +69,7 @@ intrpt()
        while (read(0, p, 1) == 1 && *p != '\n')
                p++;
        if (response[0] != 'y')
        while (read(0, p, 1) == 1 && *p != '\n')
                p++;
        if (response[0] != 'y')
-               wrapup(1);
+               wrapup(0);
        ungetc('\n', stdin);
        signal(SIGINT, intrpt);
 }
        ungetc('\n', stdin);
        signal(SIGINT, intrpt);
 }