Don't we -already- have some argv parsing code in either proc.c or the mod_cgi
that could be used for this purpose??? Let's make that exported, accessible
code from apr itself.
Bill
At 03:31 PM 8/19/2002, Paul J. Reder wrote:
>After fixing the parse_cmd code to be able to handle escaped quotes (so that
>it would process the full
> <"/bin/awk '{print NR\": \" $N}'">
>instead of just
> <"/bin/awk '{print NR\">
>(and then an error for the <: \" $N}'"> part)) I ran into what appears to be
>the next problem.
>
>In parse_cmd it runs
>
> /* parms now has the command-line to parse */
> while (filter->numArgs < 30 &&
> strlen(filter->args[filter->numArgs] =
> ap_getword_white_nc(p, &parms))) {
> ++filter->numArgs;
> }
>
>to break the command string into an args list of tokens. This code uses
>*only* white
>space as delimeters. Thus the input command string
> "/bin/awk '{print NR\": \" $N}'"
>
>gets broken into
> /bin/awk
> '{print
> NR\":
> \"
> $N}'
>
>The question I have is, shouldn't this break down into either
> /bin/awk
> '{print NR\": \" $N}'
>or
> /bin/awk
> '{print NR\
> ": \"
> $N}'
>
>The above listed pieces end up as the args list passed on the apr_proc_create
>call.
>
>
>Thanks,
>
>--
>Paul J. Reder
>-----------------------------------------------------------
>"The strength of the Constitution lies entirely in the determination of each
>citizen to defend it. Only if every single citizen feels duty bound to do
>his share in this defense are the constitutional rights secure."
>-- Albert Einstein
>