fix 'typeset -p' to act according to TFM and ksh93

This commit is contained in:
tg 2006-11-19 17:13:36 +00:00
parent b21875f20f
commit 8a4b64fde3
1 changed files with 3 additions and 5 deletions

View File

@ -5,7 +5,7 @@
#include "sh.h"
__RCSID("$MirOS: src/bin/mksh/funcs.c,v 1.37 2006/11/12 14:58:14 tg Exp $");
__RCSID("$MirOS: src/bin/mksh/funcs.c,v 1.38 2006/11/19 17:13:36 tg Exp $");
int
c_cd(char **wp)
@ -583,7 +583,7 @@ c_typeset(char **wp)
* here for compatibility with ksh93.
*/
pflag = 1;
break;
continue;
case 'r':
flag = RDONLY;
break;
@ -768,9 +768,7 @@ c_typeset(char **wp)
break;
} else {
if (pflag)
shprintf("%s ",
(flag & EXPORT) ?
"export" : "readonly");
shprintf("typeset ");
if ((vp->flag&ARRAY) && any_set)
shprintf("%s[%d]",
vp->name, vp->index);