setexit -> setjmp, reset -> longjmp, isdir() -> S_ISDIR, ANSI
[unix-history] / usr / src / bin / csh / err.c
index d4c053e..72c19d4 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.4 (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,16 +77,10 @@ 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);
-       reset();                /* Unwind */
+       longjmp(reslab, 0);             /* Unwind */
 }
 
 /*
 }
 
 /*