int getTokenStr(char **pp, char *buf, int maxlen) { char *p = *pp; if (*p == '"') { p++; while (*p && *p != '"' && --maxlen) *buf++ = *p++; p++; } else { while (*p > ' ' && --maxlen) *buf++ = *p++; } *buf = 0; *pp = p; return 1; }