• Allow setting both -o posix and -o sh (although only in the same
command; setting one still unsets the other at first) • Change subst_exstat to be conformant unless -o sh is set and -o posix isn’t • In lksh, make subst_exstat (newly) conformant if -o posix • New MKSH_BINSHPOSIX to accompany MKSH_BINSHREDUCED • Sync lksh manpage precisely
This commit is contained in:
9
funcs.c
9
funcs.c
@ -38,7 +38,7 @@
|
||||
#endif
|
||||
#endif
|
||||
|
||||
__RCSID("$MirOS: src/bin/mksh/funcs.c,v 1.242 2013/04/26 21:22:45 tg Exp $");
|
||||
__RCSID("$MirOS: src/bin/mksh/funcs.c,v 1.243 2013/05/02 20:21:41 tg Exp $");
|
||||
|
||||
#if HAVE_KILLPG
|
||||
/*
|
||||
@ -2426,12 +2426,13 @@ c_set(const char **wp)
|
||||
* which assumes the exit value set will be that of the $()
|
||||
* (subst_exstat is cleared in execute() so that it will be 0
|
||||
* if there are no command substitutions).
|
||||
* Switched ksh (!posix !sh) to POSIX in mksh R39b.
|
||||
*/
|
||||
#ifdef MKSH_LEGACY_MODE
|
||||
return (subst_exstat);
|
||||
/* traditional behaviour, unless set -o posix */
|
||||
return (Flag(FPOSIX) ? 0 : subst_exstat);
|
||||
#else
|
||||
return (Flag(FSH) ? subst_exstat : 0);
|
||||
/* conformant behaviour, unless set -o sh +o posix */
|
||||
return (Flag(FSH) && !Flag(FPOSIX) ? subst_exstat : 0);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user