/*
	call.c - a program that will allow execution of .BAT files from
		within other .BAT files. Similar to CALL in MS-DOS 4.x
*/

#include <stdio.h>
#include <process.h>

char *pdnotice1 = "Placed in the public domain by the author.\n",
	  *pdnotice2 = "Gene McManus, gmcmanus@dsac.dla.mil\n";

main(argc, argv)
int argc;
char *argv[];
	{
	register int i = 1;
	char *command, *malloc();

	command = malloc(256);
	if(command == NULL)
		{
		fputs("Cannot allocate memory for command line buffer\n", stderr);
		exit(3);
		}
	command[0] = '\0';
	for(; i <= argc; i++)
		{
		strcat(command, argv[i]);
		strcat(command, " ");
		}
	i = system(command);
	free(command);
	exit(i);
	}
