summaryrefslogtreecommitdiff
path: root/Src
diff options
context:
space:
mode:
Diffstat (limited to 'Src')
-rw-r--r--Src/builtin.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/Src/builtin.c b/Src/builtin.c
index 5c5adb9d3..dd352c146 100644
--- a/Src/builtin.c
+++ b/Src/builtin.c
@@ -2031,8 +2031,10 @@ typeset_single(char *cname, char *pname, Param pm, int func,
char *subscript;
if (pm && (pm->node.flags & PM_NAMEREF) && !((off|on) & PM_NAMEREF)) {
- if (!(off & PM_NAMEREF))
- pm = (Param)resolve_nameref(pm, NULL);
+ if (!(off & PM_NAMEREF)) {
+ if ((pm = (Param)resolve_nameref(pm, NULL)))
+ pname = pm->node.nam;
+ }
if (pm && (pm->node.flags & PM_NAMEREF) &&
(on & ~(PM_NAMEREF|PM_LOCAL|PM_READONLY))) {
/* Changing type of PM_SPECIAL|PM_AUTOLOAD is a fatal error. *