[PATCH] modprobe and multiple options to modules

Tito farmatito at tiscali.it
Fri Sep 30 12:07:51 UTC 2005


On Friday 30 September 2005 08:30, Yann E. MORIN wrote:
> Hi!
> 
> Quoting Rob Landley <rob at landley.net>:
> > Sounds like you've got a good handle on things.  I look forward to seeing the
> > result...
> 
> Hmm. Looks like not to me. As of now, I've broken the string parsing into
> finding the begining of an argument (the first char in the string that is not
> a space), and the end of the argument (the next first char that is not escaped
> and not between quotes). Single- and double-quotes evaluation (not yet fully
> compliant to traditional sh I guess...) Plus some escaping evaluation ('\"',
> '\'', '\ ', plus all the \a\b\t\n\v\f\r\0.
> 
> So far the original command string was modified by the function, and I don't
> find it very interesting because when we want variables expansion, then we
> would need to expand/shrink the string at will. So I started xstrdup'ing the
> original string to get a working copy of the current argument (with trailing
> garbage being the remaining args).
> 
> It is the responsibility of the caller to iterate over the arguments, and
> free the xstrdup'ed arguments. And I conditionned the memory freeing to
> CONFIG_FEATURE_CLEAN_UP being defined (or we leak memory when looping for
> dependencies).
> 
> But for now it dumps core... :-(
> 
> static char* parse_command_string( char* src, char **dst );
> /*   src: pointer to string containing options
>  *   dst: pointer to where to store the parsed option
>  *   return value: the pointer to the first char after the parsed option,
>  *                 NULL if there was no option parsed (only trailing spaces).
>  *   Note that memory is allocated with bb_xstrdup when a new argument
>  *   was parsed. Don't forget to free it!
>  */
> 
> Tonight for a status update (or earlier when I have something working!).
> 
> Regards,
> Yann.
> 
> --
> Yann E. MORIN
Hi,
would be nice if you attach also the code,
so we could take a look at it.

Ciao,
Tito



More information about the busybox mailing list