make 'typeset -f' output reentrant in the face of functions whose

names are keywords and a GNU bash extension (gah!); reported by izabera
This commit is contained in:
tg 2015-08-13 20:54:03 +00:00
parent c2d9863a05
commit fdb9509fe5
1 changed files with 3 additions and 1 deletions

4
tree.c
View File

@ -23,7 +23,7 @@
#include "sh.h"
__RCSID("$MirOS: src/bin/mksh/tree.c,v 1.73 2015/04/11 22:03:32 tg Exp $");
__RCSID("$MirOS: src/bin/mksh/tree.c,v 1.74 2015/08/13 20:54:03 tg Exp $");
#define INDENT 8
@ -748,6 +748,8 @@ fpFUNCTf(struct shf *shf, int i, bool isksh, const char *k, struct op *v)
{
if (isksh)
fptreef(shf, i, "%s %s %T", Tfunction, k, v);
else if (ktsearch(&keywords, k, hash(k)))
fptreef(shf, i, "%s %s() %T", Tfunction, k, v);
else
fptreef(shf, i, "%s() %T", k, v);
}