mirror of the now-defunct rocklinux.org
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

110 lines
2.8 KiB

  1. # --- ROCK-COPYRIGHT-NOTE-BEGIN ---
  2. #
  3. # This copyright note is auto-generated by ./scripts/Create-CopyPatch.
  4. # Please add additional copyright information _after_ the line containing
  5. # the ROCK-COPYRIGHT-NOTE-END tag. Otherwise it might get removed by
  6. # the ./scripts/Create-CopyPatch script. Do not edit this copyright text!
  7. #
  8. # ROCK Linux: rock-src/package/base/pdksh/pdksh-5.2.14-2.patch
  9. # ROCK Linux is Copyright (C) 1998 - 2005 Clifford Wolf
  10. #
  11. # This patch file is dual-licensed. It is available under the license the
  12. # patched project is licensed under, as long as it is an OpenSource license
  13. # as defined at http://www.opensource.org/ (e.g. BSD, X11) or under the terms
  14. # of the GNU General Public License as published by the Free Software
  15. # Foundation; either version 2 of the License, or (at your option) any later
  16. # version.
  17. #
  18. # --- ROCK-COPYRIGHT-NOTE-END ---
  19. [ ftp://ftp.cs.mun.ca/pub/pdksh/pdksh-5.2.14-patches.2 ]
  20. --- ./exec.c.a Mon Jan 29 10:02:13 2001
  21. +++ ./exec.c Mon Jan 29 10:06:57 2001
  22. @@ -76,6 +76,7 @@
  23. {
  24. int i;
  25. volatile int rv = 0;
  26. + volatile int rv_prop = 0; /* rv being propogated or newly generated? */
  27. int pv[2];
  28. char ** volatile ap;
  29. char *s, *cp;
  30. @@ -157,6 +158,7 @@
  31. case TPAREN:
  32. rv = execute(t->left, flags|XFORK);
  33. + rv_prop = 1;
  34. break;
  35. case TPIPE:
  36. @@ -275,6 +277,7 @@
  37. rv = execute(t->right, flags & XERROK);
  38. else
  39. flags |= XERROK;
  40. + rv_prop = 1;
  41. break;
  42. case TBANG:
  43. @@ -323,6 +326,7 @@
  44. }
  45. }
  46. rv = 0; /* in case of a continue */
  47. + rv_prop = 1;
  48. if (t->type == TFOR) {
  49. while (*ap != NULL) {
  50. setstr(global(t->str), *ap++, KSH_SS_UNWIND_ERROR);
  51. @@ -334,6 +338,7 @@
  52. for (;;) {
  53. if (!(cp = do_selectargs(ap, is_first))) {
  54. rv = 1;
  55. + rv_prop = 0;
  56. break;
  57. }
  58. is_first = FALSE;
  59. @@ -365,6 +370,7 @@
  60. rv = 0; /* in case of a continue */
  61. while ((execute(t->left, XERROK) == 0) == (t->type == TWHILE))
  62. rv = execute(t->right, flags & XERROK);
  63. + rv_prop = 1;
  64. break;
  65. case TIF:
  66. @@ -374,6 +380,7 @@
  67. rv = execute(t->left, XERROK) == 0 ?
  68. execute(t->right->left, flags & XERROK) :
  69. execute(t->right->right, flags & XERROK);
  70. + rv_prop = 1;
  71. break;
  72. case TCASE:
  73. @@ -386,10 +393,12 @@
  74. break;
  75. Found:
  76. rv = execute(t->left, flags & XERROK);
  77. + rv_prop = 1;
  78. break;
  79. case TBRACE:
  80. rv = execute(t->left, flags & XERROK);
  81. + rv_prop = 1;
  82. break;
  83. case TFUNCT:
  84. @@ -401,6 +410,7 @@
  85. * (allows "ls -l | time grep foo").
  86. */
  87. rv = timex(t, flags & ~XEXEC);
  88. + rv_prop = 1;
  89. break;
  90. case TEXEC: /* an eval'd TCOM */
  91. @@ -428,7 +438,7 @@
  92. quitenv(); /* restores IO */
  93. if ((flags&XEXEC))
  94. unwind(LEXIT); /* exit child */
  95. - if (rv != 0 && !(flags & XERROK)) {
  96. + if (rv != 0 && !rv_prop && !(flags & XERROK)) {
  97. if (Flag(FERREXIT))
  98. unwind(LERROR);
  99. trapsig(SIGERR_);