Re: [PATCH v2 2/4] config: drop file pointer validity check in get_next_char()

2013-03-12 Thread Jeff King
On Sun, Mar 10, 2013 at 05:58:57PM +0100, Heiko Voigt wrote: The only location where cf is set in this file is in do_config_from(). This function has only one callsite which is config_from_file(). In config_from_file() its ensured that the f member is set to non-zero. [...] - if (cf ((f

Re: [PATCH v2 2/4] config: drop file pointer validity check in get_next_char()

2013-03-12 Thread Heiko Voigt
On Tue, Mar 12, 2013 at 07:00:03AM -0400, Jeff King wrote: On Sun, Mar 10, 2013 at 05:58:57PM +0100, Heiko Voigt wrote: The only location where cf is set in this file is in do_config_from(). This function has only one callsite which is config_from_file(). In config_from_file() its ensured

Re: [PATCH v2 2/4] config: drop file pointer validity check in get_next_char()

2013-03-12 Thread Heiko Voigt
On Tue, Mar 12, 2013 at 05:00:56PM +0100, Heiko Voigt wrote: On Tue, Mar 12, 2013 at 07:00:03AM -0400, Jeff King wrote: On Sun, Mar 10, 2013 at 05:58:57PM +0100, Heiko Voigt wrote: The only location where cf is set in this file is in do_config_from(). This function has only one

Re: [PATCH v2 2/4] config: drop file pointer validity check in get_next_char()

2013-03-12 Thread Jeff King
On Tue, Mar 12, 2013 at 05:00:56PM +0100, Heiko Voigt wrote: That is, every path to get_next_char happens while we are in git_config_from_file, and that function guarantees that cf = top, and that top.f != NULL. We do not have to even do any analysis of the conditions for each call,

[PATCH v2 2/4] config: drop file pointer validity check in get_next_char()

2013-03-10 Thread Heiko Voigt
The only location where cf is set in this file is in do_config_from(). This function has only one callsite which is config_from_file(). In config_from_file() its ensured that the f member is set to non-zero. Signed-off-by: Heiko Voigt hvo...@hvoigt.net --- config.c | 4 ++-- 1 file changed, 2