diff options
Diffstat (limited to 'system/pdksh/patches/103_PLD-pdksh-unset.patch')
-rw-r--r-- | system/pdksh/patches/103_PLD-pdksh-unset.patch | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/system/pdksh/patches/103_PLD-pdksh-unset.patch b/system/pdksh/patches/103_PLD-pdksh-unset.patch new file mode 100644 index 0000000000..9f17b9409b --- /dev/null +++ b/system/pdksh/patches/103_PLD-pdksh-unset.patch @@ -0,0 +1,26 @@ +unset on unknown variable is not an error, +see http://www.opengroup.org/onlinepubs/009695399/utilities/unset.html +(from PLD) + +Index: pdksh-5.2.14/c_sh.c +=================================================================== +--- pdksh-5.2.14.orig/c_sh.c 2008-04-15 20:51:18.000000000 +0200 ++++ pdksh-5.2.14/c_sh.c 2008-04-15 20:56:22.000000000 +0200 +@@ -688,16 +688,13 @@ + if (unset_var) { /* unset variable */ + struct tbl *vp = global(id); + +- if (!(vp->flag & ISSET)) +- ret = 1; + if ((vp->flag&RDONLY)) { + bi_errorf("%s is read only", vp->name); + return 1; + } + unset(vp, strchr(id, '[') ? 1 : 0); + } else { /* unset function */ +- if (define(id, (struct op *) NULL)) +- ret = 1; ++ define(id, (struct op *) NULL); + } + return ret; + } |