summary refs log tree commit diff
diff options
context:
space:
mode:
authorOliver Kiddle <okiddle@yahoo.co.uk>2019-05-14 23:36:59 +0200
committerOliver Kiddle <okiddle@yahoo.co.uk>2019-05-14 23:36:59 +0200
commitfae7c853319798e170a0bcf1b3098b1a07447c70 (patch)
tree530d52db5b7801ad238c474512ab7de19054d3bb
parentb5519b372beaa5b954e5db5a6098bce24ff088f9 (diff)
downloadzsh-fae7c853319798e170a0bcf1b3098b1a07447c70.tar.gz
zsh-fae7c853319798e170a0bcf1b3098b1a07447c70.tar.xz
zsh-fae7c853319798e170a0bcf1b3098b1a07447c70.zip
44284: combination of -T and -p to typeset crashed the shell.
-rw-r--r--ChangeLog3
-rw-r--r--Src/builtin.c6
2 files changed, 5 insertions, 4 deletions
diff --git a/ChangeLog b/ChangeLog
index c5d7e62ff..9cdb70ba7 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
 2019-05-14  Oliver Kiddle  <okiddle@yahoo.co.uk>
 
+	* 44284: Src/builtin.c: combination of -T and -p to typeset
+	crashed the shell.
+
 	* 44290: Src/jobs.c: job number exceeding int range and wrapping
 	to a negative number crashed the shell.
 
diff --git a/Src/builtin.c b/Src/builtin.c
index 5fbb86635..2453f82c0 100644
--- a/Src/builtin.c
+++ b/Src/builtin.c
@@ -2582,9 +2582,7 @@ typeset_single(char *cname, char *pname, Param pm, UNUSED(int func),
 	}
     }
     pm->node.flags |= (on & PM_READONLY);
-
-    if (OPT_ISSET(ops,'p'))
-	paramtab->printnode(&pm->node, PRINT_TYPESET);
+    DPUTS(OPT_ISSET(ops,'p'), "BUG: -p not handled");
 
     return pm;
 }
@@ -2714,7 +2712,7 @@ bin_typeset(char *name, char **argv, LinkList assigns, Options ops, int func)
 	(!isset(GLOBALEXPORT) && !OPT_ISSET(ops,'g')))
 	on |= PM_LOCAL;
 
-    if (on & PM_TIED) {
+    if ((on & PM_TIED) && !OPT_ISSET(ops, 'p')) {
 	Param apm;
 	struct asgment asg0, asg2;
 	char *oldval = NULL, *joinstr;