Junio C Hamano <gitster@xxxxxxxxx> writes: > Christian Couder <chriscool@xxxxxxxxxxxxx> writes: > >> Yeah, but it seems a bit wasteful to allocate memory for a new string, >> then downcase it, then compare it with strcmp() and then free it, >> instead of just using strcasecmp() on the original string. > > I wasn't looking at the caller (and I haven't). I agree that, if > you have to compare case-insensitive user input against known set of > tokens, using strcasecmp() would be saner than making a downcased > copy and the set of known tokens. I do not know however you want to > compare in a case-insensitive way in your application, though. It appears that one place this "lowercase" is used is to allow rAnDOm casing in the configuration file, e.g. [trailer "Signed-off-by"] where = AfTEr which I find is totally unnecessary. Do we churn code to accept such a nonsense input in other places? -- To unsubscribe from this list: send the line "unsubscribe git" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html