* remove redundancy
* integrate compat.h, version.h into sh.h (dependency trick didn't work anyway) * mention #ksh in mksh(1) since the founder (twkm) said it's on topic too (don't remove mention of #mksh despite it's usually empty because of control)
This commit is contained in:
10
main.c
10
main.c
@ -3,22 +3,22 @@
|
||||
/* $OpenBSD: io.c,v 1.22 2006/03/17 16:30:13 millert Exp $ */
|
||||
/* $OpenBSD: table.c,v 1.12 2005/12/11 20:31:21 otto Exp $ */
|
||||
|
||||
#define EXTERN /* define EXTERNs in sh.h */
|
||||
#define EXTERN
|
||||
#include "sh.h"
|
||||
|
||||
__RCSID("$MirOS: src/bin/mksh/main.c,v 1.46 2006/08/18 18:48:25 tg Exp $");
|
||||
__RCSID("$MirOS: src/bin/mksh/main.c,v 1.47 2006/08/22 22:49:35 tg Exp $");
|
||||
|
||||
extern char **environ;
|
||||
|
||||
static void reclaim(void);
|
||||
static void remove_temps(struct temp * tp);
|
||||
static void remove_temps(struct temp *);
|
||||
|
||||
static const char initifs[] = "IFS= \t\n";
|
||||
|
||||
static const char initsubs[] = "${PS2=> } ${PS3=#? } ${PS4=+ }";
|
||||
|
||||
static const char *initcoms[] = {
|
||||
"typeset", "-r", "KSH_VERSION", NULL,
|
||||
"typeset", "-r", initvsn, NULL,
|
||||
"typeset", "-x", "SHELL", "PATH", "HOME", NULL,
|
||||
"typeset", "-i", "PPID", "OPTIND=1", NULL,
|
||||
"eval", "typeset -i RANDOM SECONDS=\"${SECONDS-0}\" TMOUT=\"${TMOUT-0}\"", NULL,
|
||||
@ -191,8 +191,6 @@ main(int argc, char *argv[])
|
||||
srand((*((long *)kshname)) ^ ((long)time(NULL) * kshpid * ppid));
|
||||
#endif
|
||||
setint(global("PPID"), (long)ppid);
|
||||
/* setstr can't fail here */
|
||||
setstr(global("KSH_VERSION"), MKSH_VERSION, KSH_RETURN_ERROR);
|
||||
|
||||
/* execute initialisation statements */
|
||||
for (wp = (char **)initcoms; *wp != NULL; wp++) {
|
||||
|
Reference in New Issue
Block a user