aboutsummaryrefslogtreecommitdiffstats
path: root/builtins/getopts.def
diff options
context:
space:
mode:
Diffstat (limited to 'builtins/getopts.def')
-rw-r--r--builtins/getopts.def4
1 files changed, 3 insertions, 1 deletions
diff --git a/builtins/getopts.def b/builtins/getopts.def
index c077c8e..1d2a68a 100644
--- a/builtins/getopts.def
+++ b/builtins/getopts.def
@@ -108,7 +108,9 @@ getopts_bind_variable (name, value)
if (legal_identifier (name))
{
v = bind_variable (name, value, 0);
- return (v && (readonly_p (v) == 0)) ? EXECUTION_SUCCESS : EXECUTION_FAILURE;
+ if (v && (readonly_p (v) || noassign_p (v)))
+ return (EX_MISCERROR);
+ return (v ? EXECUTION_SUCCESS : EXECUTION_FAILURE);
}
else
{