Hi Padraig,

> In the attached I added a single extra orig_buffersize variable to
> control an extra read-only scan.

Thanks, it looks good.

The other recursive call to quotearg_buffer_restyled

  return quotearg_buffer_restyled (buffer, buffersize, arg, argsize,
                                   quoting_style,
                                   flags & ~QA_ELIDE_OUTER_QUOTES, NULL,
                                   left_quote, right_quote);

is also OK, because the code is careful not to make more than one
STORE (...) call per input byte if elide_outer_quotes is true. There are
enough occurrences of

              if (elide_outer_quotes)
                goto force_outer_quoting_style;

so that the string that was produced before this recursive call will
not be longer than the one produced by the recursive call. => All fine.

Bruno


Reply via email to