git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Ping Yin" <pkufranky@gmail.com>
To: "Junio C Hamano" <junio@pobox.com>
Cc: git@vger.kernel.org
Subject: Re: [PATCH v3 1/4] config.c: Add git_config_bool_or_int to handle bool/int variable
Date: Sun, 13 Apr 2008 15:30:28 +0800	[thread overview]
Message-ID: <46dff0320804130030q19dd9f23j66d9b7adc7d305d3@mail.gmail.com> (raw)
In-Reply-To: <7vmynye0cz.fsf@gitster.siamese.dyndns.org>

On Sun, Apr 13, 2008 at 2:26 PM, Junio C Hamano <junio@pobox.com> wrote:
> Ping Yin <pkufranky@gmail.com> writes:

>  -int git_config_bool(const char *name, const char *value)
>
> +int git_config_bool_or_int(const char *name, const char *value, int *is_bool)
>   {
>  +       *is_bool = 1;
>         if (!value)
>                 return 1;
>         if (!*value)
>  @@ -313,9 +314,16 @@ int git_config_bool(const char *name, const char *value)
>
>                 return 1;
>         if (!strcasecmp(value, "false") || !strcasecmp(value, "no"))
>                 return 0;
>  +       *is_bool = 0;
>
>         return git_config_int(name, value) != 0;
>   }

Should return an interger if *is_bool==0
s/!=0//


>  +int git_config_bool(const char *name, const char *value)
>  +{
>  +       int discard;
>  +       return git_config_bool_or_int(name, value, &discard);
>
>
> +}
>  +
>   int git_config_string(const char **dest, const char *var, const char *value)
>   {
>         if (!value)
>
>



-- 
Ping Yin

  parent reply	other threads:[~2008-04-13  7:31 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-04-12 15:05 [PATCH v3 0/4] builtin-status: submodule summary support Ping Yin
2008-04-12 15:05 ` [PATCH v3 1/4] config.c: Add git_config_bool_or_int to handle bool/int variable Ping Yin
2008-04-12 15:05   ` [PATCH v3 2/4] git-submodule summary: --for-status option Ping Yin
2008-04-12 15:05     ` [PATCH v3 3/4] builtin-status: submodule summary support Ping Yin
2008-04-12 15:05       ` [PATCH v3 4/4] buitin-status: Add tests for submodule summary Ping Yin
2008-04-12 15:13         ` Ping Yin
2008-04-13  6:26   ` [PATCH v3 1/4] config.c: Add git_config_bool_or_int to handle bool/int variable Junio C Hamano
2008-04-13  7:28     ` Ping Yin
2008-04-13  7:30     ` Ping Yin [this message]
2008-04-13  9:03       ` Junio C Hamano
2008-04-13 19:14         ` Junio C Hamano

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=46dff0320804130030q19dd9f23j66d9b7adc7d305d3@mail.gmail.com \
    --to=pkufranky@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=junio@pobox.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).