add Berkeley specific header; written by K. McKusick and P. Kessler
[unix-history] / usr / src / bin / csh / err.c
index d4c053e..d0e549a 100644 (file)
@@ -1,12 +1,12 @@
 /*
  * Copyright (c) 1980 Regents of the University of California.
 /*
  * Copyright (c) 1980 Regents of the University of California.
- * All rights reserved.  The Berkeley software License Agreement
+ * All rights reserved.  The Berkeley Software License Agreement
  * specifies the terms and conditions for redistribution.
  */
 
 #ifndef lint
  * specifies the terms and conditions for redistribution.
  */
 
 #ifndef lint
-static char sccsid[] = "@(#)err.c      5.1 (Berkeley) %G%";
-#endif not lint
+static char *sccsid = "@(#)err.c       5.3 (Berkeley) %G%";
+#endif
 
 #include "sh.h"
 #include <sys/ioctl.h>
 
 #include "sh.h"
 #include <sys/ioctl.h>
@@ -64,6 +64,12 @@ error(s, arg)
        }
        errspl = 0;
 
        }
        errspl = 0;
 
+       /*
+        * Go away if -e or we are a child shell
+        */
+       if (exiterr || child)
+               exit(1);
+
        /*
         * Reset the state of the input.
         * This buffered seek to end of file will also
        /*
         * Reset the state of the input.
         * This buffered seek to end of file will also
@@ -71,12 +77,6 @@ error(s, arg)
         */
        btoeof();
 
         */
        btoeof();
 
-       /*
-        * Go away if -e or we are a child shell
-        */
-       if (exiterr || child)
-               exit(1);
-
        setq("status", onev, &shvhed);
        if (tpgrp > 0)
                (void) ioctl(FSHTTY, TIOCSPGRP, (char *)&tpgrp);
        setq("status", onev, &shvhed);
        if (tpgrp > 0)
                (void) ioctl(FSHTTY, TIOCSPGRP, (char *)&tpgrp);