From: Johannes Schindelin Date: Mon, 22 Jan 2007 15:21:26 GMT Subject: Re: [PATCH] config_set_multivar(): disallow newlines in keys Message-ID: In-Reply-To: <81b0412b0701220706w65ed0657h1d69819e7879ed40@mail.gmail.com> Hi, On Mon, 22 Jan 2007, Alex Riesen wrote: > On 1/20/07, Johannes Schindelin wrote: > > --- a/config.c > > +++ b/config.c > > @@ -661,6 +661,11 @@ int git_config_set_multivar(const char* key, const > > char* value, > > goto out_free; > > } > > c = tolower(c); > > + } else if (c == '\n') { > > + fprintf(stderr, "invalid key (newline): %s\n", key); > > BTW, why config.c never uses error() or warn()? Mainly because error() was meant to be used as "return error("blabla");", and we tried to discern different failures by different return values. But yeah, I think it would be acceptable to use error() instead of fprintf() even then. BTW IMHO we will probably never libify git; too many too complicated cases exist already. Ciao, Dscho