[prev in list] [next in list] [prev in thread] [next in thread] 

List:       git
Subject:    Re: [PATCH 10/18] revert: Don't create invalid replay_opts in parse_args
From:       Christian Couder <chriscool () tuxfamily ! org>
Date:       2011-07-31 12:31:25
Message-ID: 201107311431.26187.chriscool () tuxfamily ! org
[Download RAW message or body]

On Wednesday 27 July 2011 05:19:07 Ramkumar Ramachandra wrote:
>
> +static void verify_opt_compatible(const char *me, const char *base_opt,
> ...) +{
> +	const char *this_opt;
> +	va_list ap;
> +	int set;
> +
> +	va_start(ap, base_opt);
> +	while ((this_opt = va_arg(ap, const char *))) {
> +		set = va_arg(ap, int);
> +		if (set)
> +			die(_("%s: %s cannot be used with %s"),
> +				me, this_opt, base_opt);
> +	}
> +	va_end(ap);
> +}

Question: returning in the middle of va_start() - va_end() may not be ok with 
some compilers, but I don't know how safe it is to exit()?

> +	/*
> +	 * Sequence of picks finished successfully; cleanup by
> +	 * removing the .git/sequencer directory
> +	 */
> +	strbuf_reset(&buf);
> +	strbuf_addf(&buf, "%s", git_path(SEQ_DIR));
> +	remove_dir_recursively(&buf, 0);
>  	return 0;
>  }

The "strbuf_reset(&buf)" is not needed. But a "strbuf_release(&buf)" could be 
added before the return.

Thanks,
Christian.
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic