Re: [PATCH 3/5] Rework unquote_c_style to work on a strbuf.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Pierre Habouzit <madcoder@xxxxxxxxxx> writes:

> If the gain is not obvious in the diffstat, the resulting code is more
> readable, _and_ in checkout-index/update-index we now reuse the same buffer
> to unquote strings instead of always freeing/mallocing.
>
> This also is more coherent with the next patch that reworks quoting
> functions.
>
> The quoting function is also made more efficient scanning for backslashes
> and treating portions of strings without a backslash at once.
>
> Signed-off-by: Pierre Habouzit <madcoder@xxxxxxxxxx>
> ---
>  builtin-apply.c          |  125 +++++++++++++++++++++++-----------------------
>  builtin-checkout-index.c |   27 +++++-----
>  builtin-update-index.c   |   51 ++++++++++---------
>  fast-import.c            |   47 ++++++++---------
>  mktree.c                 |   25 +++++----
>  quote.c                  |   92 ++++++++++++++++------------------
>  quote.h                  |    2 +-
>  7 files changed, 184 insertions(+), 185 deletions(-)
> ...
> diff --git a/quote.c b/quote.c
> index 4df3262..67c6527 100644
> --- a/quote.c
> +++ b/quote.c
> @@ -201,68 +201,62 @@ int quote_c_style(const char *name, char *outbuf, FILE *outfp, int no_dq)
>   * should free when done.  Updates endp pointer to point at
>   * one past the ending double quote if given.
>   */

You need to update the comment above which talks about the input
and return values.  You no longer return an allocated memory
which the caller should free.  You return something else.
-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux