[PATCH v2 2/4] config: drop file pointer validity check in get_next_char()
- From
Heiko Voigt <hvoigt@hvoigt.net>
- Date
- Mar 10, 2013, 16:58 UTC
- Message-ID
- <20130310165857.GC1136@sandbox-ub.fritz.box>
- In-Reply-To
- <20130310165642.GA1136@sandbox-ub.fritz.box>
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 <hvoigt@hvoigt.net> --- config.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/config.c b/config.c index 2c299dc..f55c43d 100644 --- a/config.c +++ b/config.c @@ -169,10 +169,10 @@ int git_config_from_parameters(config_fn_t fn, void *data) static int get_next_char(void) { int c; - FILE *f; c = '\n'; - if (cf && ((f = cf->f) != NULL)) { + if (cf) { + FILE *f = cf->f; c = fgetc(f); if (c == '\r') { /* DOS like systems */
-- 1.8.2.rc0.26.gf7384c5