Re: [PATCH] config: don't segfault when given --path with a missing value

2012-11-15 Thread Jeff King
On Tue, Nov 13, 2012 at 08:50:04PM -0800, Carlos Martín Nieto wrote: When given a variable without a value, such as '[section] var' and asking git-config to treat it as a path, git_config_pathname returns an error and doesn't modify its output parameter. show_config assumes that the call is

Re: [PATCH] config: don't segfault when given --path with a missing value

2012-11-15 Thread Jeff King
On Thu, Nov 15, 2012 at 08:08:49AM -0800, Jeff King wrote: That is definitely the right thing to do. But do we also need to take note of the error for later? After this code: } else if (types == TYPE_PATH) { - git_config_pathname(vptr, key_, value_); -

Re: [PATCH] config: don't segfault when given --path with a missing value

2012-11-15 Thread Jeff King
On Thu, Nov 15, 2012 at 08:11:50AM -0800, Jeff King wrote: Hmm, actually, we should probably propagate the error (I was thinking for some reason this was in the listing code, but it is really about getting a specific variable, and that variable does not have a sane format. We'll already have

[PATCH] config: don't segfault when given --path with a missing value

2012-11-15 Thread Carlos Martín Nieto
When given a variable without a value, such as '[section] var' and asking git-config to treat it as a path, git_config_pathname returns an error and doesn't modify its output parameter. show_config assumes that the call is always successful and sets a variable to indicate that vptr should be

Re: [PATCH] config: don't segfault when given --path with a missing value

2012-11-15 Thread Jeff King
On Thu, Nov 15, 2012 at 10:10:01AM -0800, Carlos Martín Nieto wrote: When given a variable without a value, such as '[section] var' and asking git-config to treat it as a path, git_config_pathname returns an error and doesn't modify its output parameter. show_config assumes that the call is

[PATCH] config: don't segfault when given --path with a missing value

2012-11-13 Thread Carlos Martín Nieto
When given a variable without a value, such as '[section] var' and asking git-config to treat it as a path, git_config_pathname returns an error and doesn't modify its output parameter. show_config assumes that the call is always successful and sets a variable to indicate that vptr should be