4 * splitline is a destructive argument parser, much like a very primitive
5 * form of a shell parser. it supports quotes for embedded spaces and
6 * literal quotes with the backslash escape.
9 char *splitnext(char **pos
)
14 while (*s
== ' ' || *s
== '\t') s
++;
16 while (*s
&& *s
!= ' ' && *s
!= '\t')
21 while (*s
&& *s
!= '"')
37 while (*s
== ' ' || *s
== '\t') s
++;
43 int splitline(char **argv
, int max
, char *line
)
49 for (i
= 0; *s
&& i
< max
+ 1; i
++)
50 argv
[i
] = splitnext(&s
);