]> git.ipfire.org Git - thirdparty/git.git/commit - config.c
config: simplify parsing of unit factors
authorRené Scharfe <l.s.r@web.de>
Sat, 22 Jun 2019 10:03:40 +0000 (12:03 +0200)
committerJunio C Hamano <gitster@pobox.com>
Mon, 24 Jun 2019 19:34:20 +0000 (12:34 -0700)
commit39c575c96967f325a995cf9716a46f7e924714f5
treedbc3d1e379336cd70d43d08a64061f1574dab276
parent664178e8e23fbd6d79b02ea51374015023c02102
config: simplify parsing of unit factors

Just return the value of the factor or zero for unrecognized strings
instead of using an output reference and a separate return value to
indicate success.  This is shorter and simpler.

It basically reverts that function to before c8deb5a146 ("Improve error
messages when int/long cannot be parsed from config", 2007-12-25), while
keeping the better messages, so restore its old name, get_unit_factor(),
as well.

Signed-off-by: Rene Scharfe <l.s.r@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
config.c