4 static char qsep[] = " \t\r\n";
7 qtoken(char *s, char *sep)
13 t = s; /* s is output string, t is input string */
14 while(*t!='\0' && (quoting || utfrune(sep, *t)==nil)){
25 /* quoting and we're on a quote */
27 /* end of quoted section; absorb closing quote */
32 /* doubled quote; fold one quote into two */
45 etoken(char *t, char *sep)
49 /* move to end of next token */
51 while(*t!='\0' && (quoting || utfrune(sep, *t)==nil)){
62 /* quoting and we're on a quote */
64 /* end of quoted section; absorb closing quote */
69 /* doubled quote; fold one quote into two */
76 gettokens(char *s, char **args, int maxargs, char *sep)
80 for(nargs=0; nargs<maxargs; nargs++){
81 while(*s!='\0' && utfrune(sep, *s)!=nil)
93 tokenize(char *s, char **args, int maxargs)
97 for(nargs=0; nargs<maxargs; nargs++){
98 while(*s!='\0' && utfrune(qsep, *s)!=nil)