1
0
Fork 0
mirror of git://git.code.sf.net/p/cdesktopenv/code synced 2025-03-09 15:50:02 +00:00

test/[: use a shell state bit (re: 7003aba4)

Instead of a global 'sh_in_test_builtin' integer flag, it is nicer
to use the mechanism for shell state bits, which was designed for
this sort of thing.

src/cmd/ksh93/include/defs.h,
src/cmd/ksh93/sh/defs.c:
- Remove global sh_in_test_builtin integer.
- Define new SH_INTESTCMD state bit.

src/cmd/ksh93/bltins/test.c: _ERROR_exit_b_test(), b_test():
- Use the new state bit.
This commit is contained in:
Martijn Dekker 2020-08-30 05:29:21 +01:00
parent 42301639d6
commit cd2cf236c2
3 changed files with 5 additions and 6 deletions

View file

@ -309,6 +309,7 @@ struct shared
#define SH_FCOMPLETE 17 /* set for filename completion */
#define SH_PREINIT 18 /* set with SH_INIT before parsing options */
#define SH_COMPLETE 19 /* set for command completion */
#define SH_INTESTCMD 20 /* set while test/[ command is being run */
#define SH_BASH 41
#define SH_BRACEEXPAND 42
@ -507,7 +508,6 @@ extern const char e_dict[];
# define sh_stats(x)
#endif /* SHOPT_STATS */
extern int sh_in_test_builtin;
extern int _ERROR_exit_b_test(int);
#endif