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

2001/0527/port/parse.c (diff list | history)

2001/0418/sys/src/9/port/parse.c:13,302001/0527/sys/src/9/port/parse.c:13,24 (short | long | prev | next)
Change tokenize back to getfields to avoid quoted strings. Format edits. Bug: call smalloc always.
rsc Fri Mar 4 12:44:25 2005
1999/0316    
{ 
2001/0331    
	Cmdbuf *volatile cb; 
1999/0316    
 
2001/0405    
	if(up != nil) 
		cb = smalloc(sizeof(*cb)); 
	else{ 
		cb = malloc(sizeof(*cb)); 
		if(cb == nil) 
			return nil; 
	} 
2001/0527    
	cb = smalloc(sizeof(*cb)); 
1999/0316    
	 
	if(n > sizeof(cb->buf)-1) 
		n = sizeof(cb->buf)-1; 
2001/0331    
 
2001/0405    
	if(up != nil && waserror()){ 
2001/0527    
	if(up!=nil && waserror()){ 
2001/0331    
		free(cb); 
		nexterror(); 
	} 
2001/0418/sys/src/9/port/parse.c:35,412001/0527/sys/src/9/port/parse.c:29,35
1999/0316    
	if(n > 0 && cb->buf[n-1] == '\n') 
		n--; 
	cb->buf[n] = '\0'; 
2001/0418    
	cb->nf = tokenize(cb->buf, cb->f, nelem(cb->f)); 
2001/0527    
	cb->nf = getfields(cb->buf, cb->f, nelem(cb->f), 1, " "); 
1999/0316    
	return cb; 
} 
 


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