All of lore.kernel.org
 help / color / mirror / Atom feed
From: Johannes Sixt <j.sixt@viscovery.net>
To: unlisted-recipients:; (no To-header on input)
Cc: Nguyen Thai Ngoc Duy <pclouds@gmail.com>,
	Git Mailing List <git@vger.kernel.org>
Subject: Re: [PATCH] bash-completion: fix getting strategy list
Date: Tue, 19 Aug 2008 16:57:02 +0200	[thread overview]
Message-ID: <48AADF3E.40304@viscovery.net> (raw)
In-Reply-To: <48AADDBB.1080203@viscovery.net>

Johannes Sixt schrieb:
> Nguyen Thai Ngoc Duy schrieb:
>> +	if (argc == 2 && !strcmp(argv[1], "--show-strategies")) {
>> +		for (i = 0; i < ARRAY_SIZE(all_strategy); i++)
>> +			printf("%s\n", all_strategy[i].name);
>> +		return 0;
> 
> Improved error checking, but quick and dirty:
> 
> +	if (!strcmp(argv[1], "--show-strategies")) {

Oops, not really improved. This still needs to check for argc >= 2.

> +		for (i = 0; i < ARRAY_SIZE(all_strategy); i++)
> +			printf("%s\n", all_strategy[i].name);
> +		return argc == 2 ? 0 :
> +			 error("--show-strategies does not take "
> +				"any arguments");

-- Hannes

  reply	other threads:[~2008-08-19 14:58 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-08-19 12:27 [BUG] git completion do sed on binary file Nguyen Thai Ngoc Duy
2008-08-19 13:28 ` [PATCH] bash-completion: fix getting strategy list Nguyen Thai Ngoc Duy
2008-08-19 13:35   ` Matthieu Moy
2008-08-19 13:46     ` Nguyen Thai Ngoc Duy
2008-08-19 14:18   ` Shawn O. Pearce
2008-08-19 14:50   ` Johannes Sixt
2008-08-19 14:57     ` Johannes Sixt [this message]
2008-08-20 16:58     ` Nguyen Thai Ngoc Duy
2008-08-20 18:22       ` Junio C Hamano
2008-08-20 21:13       ` Junio C Hamano
2008-08-20 22:39         ` Miklos Vajna
2008-08-21  0:43           ` Nguyen Thai Ngoc Duy
2008-08-21  2:14         ` Mikael Magnusson
2008-08-21  4:45           ` Junio C Hamano
2008-08-21  5:07             ` Junio C Hamano
2008-08-21 14:06               ` Miklos Vajna

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=48AADF3E.40304@viscovery.net \
    --to=j.sixt@viscovery.net \
    --cc=git@vger.kernel.org \
    --cc=pclouds@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.