Deleted Added
full compact
eval.c (197820) eval.c (199647)
1/*-
2 * Copyright (c) 1993
3 * The Regents of the University of California. All rights reserved.
4 *
5 * This code is derived from software contributed to Berkeley by
6 * Kenneth Almquist.
7 *
8 * Redistribution and use in source and binary forms, with or without

--- 22 unchanged lines hidden (view full) ---

31 */
32
33#ifndef lint
34#if 0
35static char sccsid[] = "@(#)eval.c 8.9 (Berkeley) 6/8/95";
36#endif
37#endif /* not lint */
38#include <sys/cdefs.h>
1/*-
2 * Copyright (c) 1993
3 * The Regents of the University of California. All rights reserved.
4 *
5 * This code is derived from software contributed to Berkeley by
6 * Kenneth Almquist.
7 *
8 * Redistribution and use in source and binary forms, with or without

--- 22 unchanged lines hidden (view full) ---

31 */
32
33#ifndef lint
34#if 0
35static char sccsid[] = "@(#)eval.c 8.9 (Berkeley) 6/8/95";
36#endif
37#endif /* not lint */
38#include <sys/cdefs.h>
39__FBSDID("$FreeBSD: head/bin/sh/eval.c 197820 2009-10-06 22:00:14Z jilles $");
39__FBSDID("$FreeBSD: head/bin/sh/eval.c 199647 2009-11-22 14:04:20Z jilles $");
40
41#include <paths.h>
42#include <signal.h>
43#include <stdlib.h>
44#include <unistd.h>
45#include <sys/resource.h>
46#include <sys/wait.h> /* For WIFSIGNALED(status) */
47#include <errno.h>

--- 540 unchanged lines hidden (view full) ---

588 int pip[2];
589 struct cmdentry cmdentry;
590 struct job *jp;
591 struct jmploc jmploc;
592 struct jmploc *savehandler;
593 char *savecmdname;
594 struct shparam saveparam;
595 struct localvar *savelocalvars;
40
41#include <paths.h>
42#include <signal.h>
43#include <stdlib.h>
44#include <unistd.h>
45#include <sys/resource.h>
46#include <sys/wait.h> /* For WIFSIGNALED(status) */
47#include <errno.h>

--- 540 unchanged lines hidden (view full) ---

588 int pip[2];
589 struct cmdentry cmdentry;
590 struct job *jp;
591 struct jmploc jmploc;
592 struct jmploc *savehandler;
593 char *savecmdname;
594 struct shparam saveparam;
595 struct localvar *savelocalvars;
596 struct parsefile *savetopfile;
596 volatile int e;
597 char *lastarg;
598 int realstatus;
599 int do_clearcmdentry;
600
601 /* First expand the arguments. */
602 TRACE(("evalcommand(%p, %d) called\n", (void *)cmd, flags));
603 setstackmark(&smark);

--- 224 unchanged lines hidden (view full) ---

828 mode = (cmdentry.u.index == EXECCMD)? 0 : REDIR_PUSH;
829 if (flags == EV_BACKCMD) {
830 memout.nleft = 0;
831 memout.nextc = memout.buf;
832 memout.bufsize = 64;
833 mode |= REDIR_BACKQ;
834 }
835 savecmdname = commandname;
597 volatile int e;
598 char *lastarg;
599 int realstatus;
600 int do_clearcmdentry;
601
602 /* First expand the arguments. */
603 TRACE(("evalcommand(%p, %d) called\n", (void *)cmd, flags));
604 setstackmark(&smark);

--- 224 unchanged lines hidden (view full) ---

829 mode = (cmdentry.u.index == EXECCMD)? 0 : REDIR_PUSH;
830 if (flags == EV_BACKCMD) {
831 memout.nleft = 0;
832 memout.nextc = memout.buf;
833 memout.bufsize = 64;
834 mode |= REDIR_BACKQ;
835 }
836 savecmdname = commandname;
837 savetopfile = getcurrentfile();
836 cmdenviron = varlist.list;
837 e = -1;
838 savehandler = handler;
839 if (setjmp(jmploc.loc)) {
840 e = exception;
841 exitstatus = (e == EXINT)? SIGINT+128 : 2;
842 goto cmddone;
843 }

--- 18 unchanged lines hidden (view full) ---

862 exitshell(exitstatus);
863 }
864 }
865 handler = savehandler;
866 if (e != -1) {
867 if ((e != EXERROR && e != EXEXEC)
868 || cmdentry.special)
869 exraise(e);
838 cmdenviron = varlist.list;
839 e = -1;
840 savehandler = handler;
841 if (setjmp(jmploc.loc)) {
842 e = exception;
843 exitstatus = (e == EXINT)? SIGINT+128 : 2;
844 goto cmddone;
845 }

--- 18 unchanged lines hidden (view full) ---

864 exitshell(exitstatus);
865 }
866 }
867 handler = savehandler;
868 if (e != -1) {
869 if ((e != EXERROR && e != EXEXEC)
870 || cmdentry.special)
871 exraise(e);
872 popfilesupto(savetopfile);
870 FORCEINTON;
871 }
872 if (cmdentry.u.index != EXECCMD)
873 popredir();
874 if (flags == EV_BACKCMD) {
875 backcmd->buf = memout.buf;
876 backcmd->nleft = memout.nextc - memout.buf;
877 memout.buf = NULL;

--- 243 unchanged lines hidden ---
873 FORCEINTON;
874 }
875 if (cmdentry.u.index != EXECCMD)
876 popredir();
877 if (flags == EV_BACKCMD) {
878 backcmd->buf = memout.buf;
879 backcmd->nleft = memout.nextc - memout.buf;
880 memout.buf = NULL;

--- 243 unchanged lines hidden ---