compat/fnmatch: update old-style definition to ANSI
We usually try to avoid touching borrowed code, but we encourage people to code without old-style definition these days and compile with -Werror, and on platforms that need to use NO_FNMATCH, these three functions make the compilation fail.
Signed-off-by Junio C Hamano <[email protected]>
--- compat/fnmatch/fnmatch.c | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-)
compat/fnmatch/fnmatch.c +12 -12
@@ -135,9 +135,9 @@ extern int errno;# if !definedHAVE___STRCHRNUL && !defined _LIBCstatic char * -__strchrnul (s ,c ) - const char *s; -int c; +__strchrnul (const char *s,int c) + + {char *result =strchr (s, c);if (result ==NULL )
@@ -159,11 +159,11 @@ static int internal_fnmatch __P ((const char *pattern, const char *string,internal_function ;static int internal_function -internal_fnmatch (pattern, string, no_leading_period, flags) -const char *pattern; -const char *string; -int no_leading_period; -int flags; +internal_fnmatch (const char *pattern, const char *string, int no_leading_period, int flags) + + + + { registerconst char *p = pattern, *n = string; registerunsigned char c;
@@ -481,10 +481,10 @@ internal_fnmatch (pattern, string, no_leading_period, flags)int -fnmatch (pattern, string, flags) -const char *pattern; -const char *string; -int flags; +fnmatch (const char *pattern,const char *string,int flags) + + + {return internal_fnmatch (pattern, string, flags &FNM_PERIOD , flags); }
Signature · 1 line
1.8.1.rc2.196.g654d69e