/* Copyright (C) 1981,1982 by Manx Software Systems */
/* Copyright (C) 1981  Thomas Fenwick */
#define MAXARGS 20
static char *Argv[MAXARGS];
static char Argbuf[128];
static int Argc;

Croot()
{
	register char *cp,*args;
	register int k;

	Argv[0] = "";
	args = 0x80;
	k = *args++; /* get count of chars */
	for ( cp = Argbuf, Argc = 1 ; Argc < MAXARGS ; ++Argc ) {
		while ( k && (*args == ' ' || *args == '\t') ) {
			++args;
			--k;
		}
		if ( k <= 0 )
			break;
		Argv[Argc] = cp;
		while ( k && *args != ' ' && *args != '\t' ) {
			--k;
			*cp++ = *args++;
		}
		*cp++ = 0;
	}
	exit(main(Argc,Argv));
}

exit(code)
{
	closall_();
	if ( code )
		unlink("A:$$$.SUB");
	boot_();
}
