plan 9 kernel history: overview | file list | diff list

1997/0327/boot/aux.c (diff list | history)

1993/0901/sys/src/9/boot/aux.c:172,2021997/0327/sys/src/9/boot/aux.c:172,190 (short | long | prev | next)
1992/0317    
	return n; 
} 
1992/0530    
 
1992/0610    
/* 
 *  get second word of the terminal environment variable.   If it 
1992/0625    
 *  ends in "boot", get rid of that part. 
1992/0610    
 */ 
1992/0530    
void 
getconffile(char *conffile, char *terminal) 
1997/0327    
int 
parsefields(char *lp, char **fields, int n, char *sep) 
1992/0530    
{ 
	char *p, *q; 
1992/0610    
	char *s; 
	int n; 
1997/0327    
	int i; 
1992/0530    
 
1992/0610    
	s = conffile; 
1992/0530    
	*conffile = 0; 
	p = terminal; 
	if((p = strchr(p, ' ')) == 0 || p[1] == ' ' || p[1] == 0) 
		return; 
	p++; 
	for(q = p; *q && *q != ' '; q++) 
		; 
	while(p < q) 
		*conffile++ = *p++; 
1992/0610    
	*conffile = 0; 
                 
1992/0625    
	/* dump a trailing boot */ 
1992/0610    
	n = strlen(s); 
	if(n > 4 && strcmp(s + n - 4, "boot") == 0) 
		*(s+n-4) = 0; 
1997/0327    
	for(i=0; lp && *lp && i<n; i++){ 
		while(*lp && strchr(sep, *lp) != 0) 
			*lp++=0; 
		if(*lp == 0) 
			break; 
		fields[i]=lp; 
		while(*lp && strchr(sep, *lp) == 0) 
			lp++; 
	} 
	return i; 
1992/0530    
} 


source code copyright © 1990-2005 Lucent Technologies; see license
Plan 9 distribution
comments to russ cox (rsc@swtch.com)