xref: /titanic_41/usr/src/cmd/refer/inv3.c (revision e4f5a11d4a234623168c1558fcdf4341e11769e1)
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 #pragma ident	"%Z%%M%	%I%	%E% SMI"
16 
17 int
18 getargs(char *s, char *arps[])
19 {
20 	int i = 0;
21 
22 	while (1) {
23 		arps[i++] = s;
24 		while (*s != 0 && *s != ' ' && *s != '\t')
25 			s++;
26 		if (*s == 0)
27 			break;
28 		*s++ = 0;
29 		while (*s == ' ' || *s == '\t')
30 			s++;
31 		if (*s == 0)
32 			break;
33 	}
34 	return (i);
35 }
36