| static char qsep[] = " \t\r\n"; |
| qtoken(char *s, char *sep) |
| t = s; /* s is output string, t is input string */ |
| while(*t!='\0' && (quoting || utfrune(sep, *t)==nil)){ |
| /* quoting and we're on a quote */ |
| /* end of quoted section; absorb closing quote */ |
| /* doubled quote; fold one quote into two */ |
| etoken(char *t, char *sep) |
| /* move to end of next token */ |
| while(*t!='\0' && (quoting || utfrune(sep, *t)==nil)){ |
| /* quoting and we're on a quote */ |
| /* end of quoted section; absorb closing quote */ |
| /* doubled quote; fold one quote into two */ |
| gettokens(char *s, char **args, int maxargs, char *sep) |
| for(nargs=0; nargs<maxargs; nargs++){ |
| while(*s!='\0' && utfrune(sep, *s)!=nil) |
| tokenize(char *s, char **args, int maxargs) |
| for(nargs=0; nargs<maxargs; nargs++){ |
| while(*s!='\0' && utfrune(qsep, *s)!=nil) |