Re: [PATCH v12 03/10] strbuf: add a case insensitive starts_with()

2018-03-16 Thread Junio C Hamano
Morten Welinder writes: > You need to cast those arguments of tolower to (unsigned char). That's > arguably a bug of the language. Don't we do so in git-compat-util.h already?

Re: [PATCH v12 03/10] strbuf: add a case insensitive starts_with()

2018-03-16 Thread Morten Welinder
You need to cast those arguments of tolower to (unsigned char). That's arguably a bug of the language. Character values less than zero aren't valid for tolower, unless they happen to equal EOF in which case the tolower calls don't mean what you want them to mean. Per the man page: "If c is

[PATCH v12 03/10] strbuf: add a case insensitive starts_with()

2018-03-15 Thread lars . schneider
From: Lars Schneider Check in a case insensitive manner if one string is a prefix of another string. This function is used in a subsequent commit. Signed-off-by: Lars Schneider --- git-compat-util.h | 1 + strbuf.c | 9 + 2