Remove the hard coded length limit on variable names in config files
commit0971e992c4e2806b427a09239ee48a90280c9b15
authorBen Walton <bdwalton@gmail.com>
Sun, 30 Sep 2012 19:44:36 +0000 (30 20:44 +0100)
committerJunio C Hamano <gitster@pobox.com>
Mon, 1 Oct 2012 19:27:45 +0000 (1 12:27 -0700)
tree6532e27471433737cf22873d915a704282a9d595
parentd8cf053dacb4f78920c112d10c7be21e4f5a5817
Remove the hard coded length limit on variable names in config files

Previously while reading the variable names in config files, there
was a 256 character limit with at most 128 of those characters being
used by the section header portion of the variable name.  This
limitation was only enforced while reading the config files.  It was
possible to write a config file that was not subsequently readable.

Instead of enforcing this limitation for both reading and writing,
remove it entirely by changing the var member of the config_file
struct to a strbuf instead of a fixed length buffer.  Update all of
the parsing functions in config.c to use the strbuf instead of the
static buffer.

The parsing functions that returned the base length of the variable
name now return simply 0 for success and -1 for failure.  The base
length information is obtained through the strbuf's len member.

We now send the buf member of the strbuf to external callback
functions to preserve the external api.  None of the external
callers rely on the old size limitation for sizing their own buffers
so removing the limit should have no externally visible effect.

Signed-off-by: Ben Walton <bdwalton@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
config.c