From fae7c853319798e170a0bcf1b3098b1a07447c70 Mon Sep 17 00:00:00 2001 From: Oliver Kiddle Date: Tue, 14 May 2019 23:36:59 +0200 Subject: 44284: combination of -T and -p to typeset crashed the shell. --- ChangeLog | 3 +++ Src/builtin.c | 6 ++---- 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 + * 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; -- cgit 1.4.1