Re: [PATCH] diff.c: guard config parser from value=NULL

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

 



On Sun, Feb 10, 2008 at 06:35:34PM +0000, Christian Couder wrote:
> In fact we also guard for value="" as it doesn't make more sense
> for the variables here.
> 
> We do that by using a new function 'xstrdup_confval' to avoid code
> duplication.
> 
> By the way this changes a 'strdup' into 'xstrdup'.
> 
> Signed-off-by: Christian Couder <chriscool@xxxxxxxxxxxxx>
> ---
>  diff.c |   23 +++++++++++++----------
>  1 files changed, 13 insertions(+), 10 deletions(-)
> 
> diff --git a/diff.c b/diff.c
> index 5b8afdc..d51aecb 100644
> --- a/diff.c
> +++ b/diff.c
> @@ -60,6 +60,14 @@ static struct ll_diff_driver {
>  	char *cmd;
>  } *user_diff, **user_diff_tail;
>  
> +static int xstrdup_confval(const char *dest, const char *var, const char *value)

  Why not calling that "git_config_string" in config.[hc] and be
API-consistent ?

-- 
·O·  Pierre Habouzit
··O                                                madcoder@xxxxxxxxxx
OOO                                                http://www.madism.org

Attachment: pgpw3OPron4VS.pgp
Description: PGP signature


[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