diff options
author | Paul Ackersviller <packersv@users.sourceforge.net> | 2007-04-30 04:10:42 +0000 |
---|---|---|
committer | Paul Ackersviller <packersv@users.sourceforge.net> | 2007-04-30 04:10:42 +0000 |
commit | e487e17e93ae396d5546f2b4aa00049f2567b540 (patch) | |
tree | b0cb7d1c346579f5e32d8b53e662f5550c7579a4 /Src/builtin.c | |
parent | c82d284f3861242c1e84f46bdfacaab000edf274 (diff) | |
download | zsh-e487e17e93ae396d5546f2b4aa00049f2567b540.tar.gz zsh-e487e17e93ae396d5546f2b4aa00049f2567b540.tar.xz zsh-e487e17e93ae396d5546f2b4aa00049f2567b540.zip |
Merge of 20955: "unset foo" should return status 0 if foo was not set.
Diffstat (limited to 'Src/builtin.c')
-rw-r--r-- | Src/builtin.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/Src/builtin.c b/Src/builtin.c index 1af193f8f..1d9f458e6 100644 --- a/Src/builtin.c +++ b/Src/builtin.c @@ -2728,8 +2728,12 @@ bin_unset(char *name, char **argv, Options ops, int func) pm = (Param) (paramtab == realparamtab ? gethashnode2(paramtab, s) : paramtab->getnode(paramtab, s)); + /* + * Unsetting an unset variable is not an error. + * This appears to be reasonably standard behaviour. + */ if (!pm) - returnval = 1; + continue; else if ((pm->flags & PM_RESTRICTED) && isset(RESTRICTED)) { zerrnam(name, "%s: restricted", pm->nam, 0); returnval = 1; |