Re: [PATCH] remote: check config validity before creating rewrite struct

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

 



Jeff King <peff@xxxxxxxx> writes:

> This was a minor cleanup I mentioned in:
>
>   https://public-inbox.org/git/20181122173109.GI28192@xxxxxxxxxxxxxxxxxxxxx/
>
> but didn't get picked up.

Yeah, that does sound vaguely familiar ;-)  Thanks, will queue.

>
>  remote.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/remote.c b/remote.c
> index 670dd44813..9cc3b07d21 100644
> --- a/remote.c
> +++ b/remote.c
> @@ -337,14 +337,14 @@ static int handle_config(const char *key, const char *value, void *cb)
>  		if (!name)
>  			return 0;
>  		if (!strcmp(subkey, "insteadof")) {
> -			rewrite = make_rewrite(&rewrites, name, namelen);
>  			if (!value)
>  				return config_error_nonbool(key);
> +			rewrite = make_rewrite(&rewrites, name, namelen);
>  			add_instead_of(rewrite, xstrdup(value));
>  		} else if (!strcmp(subkey, "pushinsteadof")) {
> -			rewrite = make_rewrite(&rewrites_push, name, namelen);
>  			if (!value)
>  				return config_error_nonbool(key);
> +			rewrite = make_rewrite(&rewrites_push, name, namelen);
>  			add_instead_of(rewrite, xstrdup(value));
>  		}
>  	}



[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