[PATCH] modprobe: handle module arguments containing spaces

Peter Korsgaard peter at korsgaard.com
Wed Sep 9 13:06:05 UTC 2015


>>>>> "Denys" == Denys Vlasenko <vda.linux at googlemail.com> writes:

Hi,

>> +/* like strsep(&stringp, "\n\t ") but handles quotes (") */
 >> +static char *split_quotes(char **stringp)
 >> +{
 >> +       char *s, *start = *stringp;
 >> +
 >> +       if (!start)
 >> +               return NULL;
 >> +
 >> +       for (s = start; ; s++) {
 >> +               switch (*s) {
 >> +               case '"':
 >> +                       s = strchr(s + 1, '"'); /* find trailing quote */
 >> +                       if (*s != '\0')
 >> +                               s++; /* skip trailing quote */

 > bug, you must be thinking about using strchrnul().

Argh, indeed - Sorry about that.

 > Applied with small changes, thanks

Thanks!

-- 
Peter Korsgaard 


More information about the busybox mailing list