fix 'typeset -p' to act according to TFM and ksh93
This commit is contained in:
parent
b21875f20f
commit
8a4b64fde3
8
funcs.c
8
funcs.c
@ -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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user