# --- ROCK-COPYRIGHT-NOTE-BEGIN ---
|
|
#
|
|
# This copyright note is auto-generated by ./scripts/Create-CopyPatch.
|
|
# Please add additional copyright information _after_ the line containing
|
|
# the ROCK-COPYRIGHT-NOTE-END tag. Otherwise it might get removed by
|
|
# the ./scripts/Create-CopyPatch script. Do not edit this copyright text!
|
|
#
|
|
# ROCK Linux: rock-src/package/base/pdksh/pdksh-5.2.14-2.patch
|
|
# ROCK Linux is Copyright (C) 1998 - 2003 Clifford Wolf
|
|
#
|
|
# This program is free software; you can redistribute it and/or modify
|
|
# it under the terms of the GNU General Public License as published by
|
|
# the Free Software Foundation; either version 2 of the License, or
|
|
# (at your option) any later version. A copy of the GNU General Public
|
|
# License can be found at Documentation/COPYING.
|
|
#
|
|
# Many people helped and are helping developing ROCK Linux. Please
|
|
# have a look at http://www.rocklinux.org/ and the Documentation/TEAM
|
|
# file for details.
|
|
#
|
|
# --- ROCK-COPYRIGHT-NOTE-END ---
|
|
|
|
|
|
[ ftp://ftp.cs.mun.ca/pub/pdksh/pdksh-5.2.14-patches.2 ]
|
|
|
|
--- ./exec.c.a Mon Jan 29 10:02:13 2001
|
|
+++ ./exec.c Mon Jan 29 10:06:57 2001
|
|
@@ -76,6 +76,7 @@
|
|
{
|
|
int i;
|
|
volatile int rv = 0;
|
|
+ volatile int rv_prop = 0; /* rv being propogated or newly generated? */
|
|
int pv[2];
|
|
char ** volatile ap;
|
|
char *s, *cp;
|
|
@@ -157,6 +158,7 @@
|
|
|
|
case TPAREN:
|
|
rv = execute(t->left, flags|XFORK);
|
|
+ rv_prop = 1;
|
|
break;
|
|
|
|
case TPIPE:
|
|
@@ -275,6 +277,7 @@
|
|
rv = execute(t->right, flags & XERROK);
|
|
else
|
|
flags |= XERROK;
|
|
+ rv_prop = 1;
|
|
break;
|
|
|
|
case TBANG:
|
|
@@ -323,6 +326,7 @@
|
|
}
|
|
}
|
|
rv = 0; /* in case of a continue */
|
|
+ rv_prop = 1;
|
|
if (t->type == TFOR) {
|
|
while (*ap != NULL) {
|
|
setstr(global(t->str), *ap++, KSH_SS_UNWIND_ERROR);
|
|
@@ -334,6 +338,7 @@
|
|
for (;;) {
|
|
if (!(cp = do_selectargs(ap, is_first))) {
|
|
rv = 1;
|
|
+ rv_prop = 0;
|
|
break;
|
|
}
|
|
is_first = FALSE;
|
|
@@ -365,6 +370,7 @@
|
|
rv = 0; /* in case of a continue */
|
|
while ((execute(t->left, XERROK) == 0) == (t->type == TWHILE))
|
|
rv = execute(t->right, flags & XERROK);
|
|
+ rv_prop = 1;
|
|
break;
|
|
|
|
case TIF:
|
|
@@ -374,6 +380,7 @@
|
|
rv = execute(t->left, XERROK) == 0 ?
|
|
execute(t->right->left, flags & XERROK) :
|
|
execute(t->right->right, flags & XERROK);
|
|
+ rv_prop = 1;
|
|
break;
|
|
|
|
case TCASE:
|
|
@@ -386,10 +393,12 @@
|
|
break;
|
|
Found:
|
|
rv = execute(t->left, flags & XERROK);
|
|
+ rv_prop = 1;
|
|
break;
|
|
|
|
case TBRACE:
|
|
rv = execute(t->left, flags & XERROK);
|
|
+ rv_prop = 1;
|
|
break;
|
|
|
|
case TFUNCT:
|
|
@@ -401,6 +410,7 @@
|
|
* (allows "ls -l | time grep foo").
|
|
*/
|
|
rv = timex(t, flags & ~XEXEC);
|
|
+ rv_prop = 1;
|
|
break;
|
|
|
|
case TEXEC: /* an eval'd TCOM */
|
|
@@ -428,7 +438,7 @@
|
|
quitenv(); /* restores IO */
|
|
if ((flags&XEXEC))
|
|
unwind(LEXIT); /* exit child */
|
|
- if (rv != 0 && !(flags & XERROK)) {
|
|
+ if (rv != 0 && !rv_prop && !(flags & XERROK)) {
|
|
if (Flag(FERREXIT))
|
|
unwind(LERROR);
|
|
trapsig(SIGERR_);
|