disambiguate $((…)) vs. $((…)…) in “typeset -f” output

This commit is contained in:
tg 2017-04-11 12:34:04 +00:00
parent ca6bd1f99b
commit 15e4861f71
2 changed files with 40 additions and 38 deletions

View File

@ -1,4 +1,4 @@
# $MirOS: src/bin/mksh/check.t,v 1.773 2017/04/08 01:07:12 tg Exp $ # $MirOS: src/bin/mksh/check.t,v 1.774 2017/04/11 12:34:02 tg Exp $
# -*- mode: sh -*- # -*- mode: sh -*-
#- #-
# Copyright © 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, # Copyright © 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010,

4
tree.c
View File

@ -23,7 +23,7 @@
#include "sh.h" #include "sh.h"
__RCSID("$MirOS: src/bin/mksh/tree.c,v 1.87 2017/04/06 01:59:58 tg Exp $"); __RCSID("$MirOS: src/bin/mksh/tree.c,v 1.88 2017/04/11 12:34:04 tg Exp $");
#define INDENT 8 #define INDENT 8
@ -365,6 +365,8 @@ wdvarput(struct shf *shf, const char *wp, int quotelevel, int opmode)
case COMSUB: case COMSUB:
shf_puts("$(", shf); shf_puts("$(", shf);
cs = ")"; cs = ")";
if (*wp == '(' /*)*/)
shf_putc(' ', shf);
pSUB: pSUB:
while ((c = *wp++) != 0) while ((c = *wp++) != 0)
shf_putc(c, shf); shf_putc(c, shf);