OpenSDE Packages Database (without history before r20070)
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.

108 lines
2.7 KiB

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