On Tue, Feb 16, 2010 at 5:26 PM, Dan Poirier <[email protected]> wrote:
> On Tue, Feb 16, 2010, at 04:03:33 PM, Jeff Trawick <[email protected]> wrote:
>
>> FWLIW, sooner or later somebody will want quoting around args with
>> embedded blanks
>> (surprisingly there doesn't seem to be an existing function to do this
>> work)
>
> Maybe something along these lines would be useful?
>
> /**
> * Concatenate multiple strings specified in a writev-style vector.
> * The separator between strings is the sep argument, and each string
> * has the quote argument preceding and following it.
> *
> * @param p The pool from which to allocate
> * @param vec The strings to concatenate
> * @param nvec The number of strings to concatenate
> * @param nbytes (output) strlen of new string (pass in NULL to omit)
> * @param sep String to place between each input string (pass in NULL to omit)
> * @param quote String to place around each input string (pass in NULL to
> omit)
> * @return The new string
> */
> APR_DECLARE(char *) apr_pstrjoinv(apr_pool_t *a, const struct iovec *vec,
> apr_size_t nvec, apr_size_t *nbytes,
> const char *sep, const char *quote);
That wouldn't work here without moving the argv to vec. ("shrug" otherwise)
I'd just like to hear someone from the crowd weigh in on whether an
API should be added to log the command line or to retrieve the command
line in a string.