search for: argv_i

Displaying 1 result from an estimated 1 matches for "argv_i".

Did you mean: argv_it
2009 Sep 11
1
[FOR REVIEW ONLY] guestfish: Enable grouping in string lists
...(sizeof (char *) * (argc+1)); - if (argv == NULL) { perror ("malloc"); exit (1); } - - p = str; - i = 0; - while (*p) { - pend = strchrnul (p, ' '); - argv[i] = strndup (p, pend-p); - i++; - p = *pend == ' ' ? pend+1 : pend; + char **argv = NULL; + size_t argv_i = 0; + + /* Current position pointer */ + const char *p = str; + + /* Token might be simple: + * Token + * or be quoted: + * 'This is a single token' + * or contain embedded single-quoted sections: + * This' is a sing'l'e to'ken + * + * The latter may see...