eval.c (228937) | eval.c (230154) |
---|---|
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 228937 2011-12-28 22:10:12Z jilles $"); | 39__FBSDID("$FreeBSD: head/bin/sh/eval.c 230154 2012-01-15 20:04:05Z 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> --- 325 unchanged lines hidden (view full) --- 373 union node *cp; 374 union node *patp; 375 struct arglist arglist; 376 struct stackmark smark; 377 378 setstackmark(&smark); 379 arglist.lastp = &arglist.list; 380 oexitstatus = exitstatus; | 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> --- 325 unchanged lines hidden (view full) --- 373 union node *cp; 374 union node *patp; 375 struct arglist arglist; 376 struct stackmark smark; 377 378 setstackmark(&smark); 379 arglist.lastp = &arglist.list; 380 oexitstatus = exitstatus; |
381 exitstatus = 0; | |
382 expandarg(n->ncase.expr, &arglist, EXP_TILDE); 383 for (cp = n->ncase.cases ; cp ; cp = cp->nclist.next) { 384 for (patp = cp->nclist.pattern ; patp ; patp = patp->narg.next) { 385 if (casematch(patp, arglist.list->text)) { 386 popstackmark(&smark); 387 while (cp->nclist.next && 388 cp->type == NCLISTFALLTHRU) { 389 evaltree(cp->nclist.body, 390 flags & ~EV_EXIT); 391 if (evalskip != 0) 392 return (NULL); 393 cp = cp->nclist.next; 394 } | 381 expandarg(n->ncase.expr, &arglist, EXP_TILDE); 382 for (cp = n->ncase.cases ; cp ; cp = cp->nclist.next) { 383 for (patp = cp->nclist.pattern ; patp ; patp = patp->narg.next) { 384 if (casematch(patp, arglist.list->text)) { 385 popstackmark(&smark); 386 while (cp->nclist.next && 387 cp->type == NCLISTFALLTHRU) { 388 evaltree(cp->nclist.body, 389 flags & ~EV_EXIT); 390 if (evalskip != 0) 391 return (NULL); 392 cp = cp->nclist.next; 393 } |
394 if (cp->nclist.body == NULL) 395 exitstatus = 0; |
|
395 return (cp->nclist.body); 396 } 397 } 398 } 399 popstackmark(&smark); | 396 return (cp->nclist.body); 397 } 398 } 399 } 400 popstackmark(&smark); |
401 exitstatus = 0; |
|
400 return (NULL); 401} 402 403 404 405/* 406 * Kick off a subshell to evaluate a tree. 407 */ --- 869 unchanged lines hidden --- | 402 return (NULL); 403} 404 405 406 407/* 408 * Kick off a subshell to evaluate a tree. 409 */ --- 869 unchanged lines hidden --- |