about summary refs log tree commit diff
path: root/Src/builtin.c
diff options
context:
space:
mode:
Diffstat (limited to 'Src/builtin.c')
-rw-r--r--Src/builtin.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/Src/builtin.c b/Src/builtin.c
index b8e76086a..586396080 100644
--- a/Src/builtin.c
+++ b/Src/builtin.c
@@ -1857,7 +1857,7 @@ bin_typeset(char *name, char **argv, char *ops, int func)
 	return 0;
     }
 
-    if (!ops['g'])
+    if (!ops['g'] && !ops['x'])
 	on |= PM_LOCAL;
 
     if (on & PM_TIED) {
@@ -1895,7 +1895,7 @@ bin_typeset(char *name, char **argv, char *ops, int func)
 	 */
 	if ((pm = (Param) paramtab->getnode(paramtab, asg0.name))
 	    && !(pm->flags & PM_UNSET)
-	    && (locallevel == pm->level || func == BIN_EXPORT)) {
+	    && (locallevel == pm->level || !(on & PM_LOCAL))) {
 	    if (!asg0.value && !(PM_TYPE(pm->flags) & (PM_ARRAY|PM_HASHED)))
 		oldval = ztrdup(getsparam(asg0.name));
 	    on |= (pm->flags & PM_EXPORTED);