659c69cfef
As suggested by Pierre Habouzit, add strchrnul(). It's a useful GNU extension and can simplify string parser code. There are several places in git that can be converted to strchrnul(); as a trivial example, this patch introduces its usage to builtin-fetch--tool.c. Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx> Signed-off-by: Junio C Hamano <gitster@pobox.com>
9 lines
127 B
C
9 lines
127 B
C
#include "../git-compat-util.h"
|
|
|
|
char *gitstrchrnul(const char *s, int c)
|
|
{
|
|
while (*s && *s != c)
|
|
s++;
|
|
return (char *)s;
|
|
}
|