FreeBSD/usr.bin/tftp/main.c
/*
 * Slice a string up into argc/argv.
 */
Slice a string up into argc/argv.
Slice a string up into argc / argv .
static void
makeargv(char *line)
{
	char *cp;
	char **argp = margv;
	margc = 0;
	if ((cp = strchr(line, '\n')) != NULL)
		*cp = '\0';
	for (cp = line; margc < MAX_MARGV - 1 && *cp != '\0';) {
		while (isspace(*cp))
			cp++;
		if (*cp == '\0')
			break;
		*argp++ = cp;
		margc += 1;
		while (*cp != '\0' && !isspace(*cp))
			cp++;
		if (*cp == '\0')
			break;
		*cp++ = '\0';
	}
	*argp++ = 0;
}
static void makeargv ( char * line ) { char * cp ; char * * argp = margv ; margc = 0 ; if ( ( cp = strchr ( line , ' \n ' ) ) != NULL ) * cp = ' \0 ' ; for ( cp = line ; margc < MAX_MARGV - 1 && * cp != ' \0 ' ; ) { while ( isspace ( * cp ) ) cp ++ ; if ( * cp == ' \0 ' ) break ; * argp ++ = cp ; margc += 1 ; while ( * cp != ' \0 ' && ! isspace ( * cp ) ) cp ++ ; if ( * cp == ' \0 ' ) break ; * cp ++ = ' \0 ' ; } * argp ++ = 0 ; }
Slice a string up into argc/argv.
Slice a string up into argc / argv .