xref: /illumos-gate/usr/src/cmd/refer/inv3.c (revision 2a8bcb4e)
1 /*
2  * Copyright 2005 Sun Microsystems, Inc.  All rights reserved.
3  * Use is subject to license terms.
4  */
5 
6 /*	Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T	*/
7 /*	  All Rights Reserved  	*/
8 
9 /*
10  * Copyright (c) 1980 Regents of the University of California.
11  * All rights reserved. The Berkeley software License Agreement
12  * specifies the terms and conditions for redistribution.
13  */
14 
15 int
getargs(char * s,char * arps[])16 getargs(char *s, char *arps[])
17 {
18 	int i = 0;
19 
20 	while (1) {
21 		arps[i++] = s;
22 		while (*s != 0 && *s != ' ' && *s != '\t')
23 			s++;
24 		if (*s == 0)
25 			break;
26 		*s++ = 0;
27 		while (*s == ' ' || *s == '\t')
28 			s++;
29 		if (*s == 0)
30 			break;
31 	}
32 	return (i);
33 }
34