mirror of
https://github.com/amadvance/snapraid.git
synced 2026-10-26 10:51:54 -04:00
Modernize fnmatch implementation to avoid warnings with new compilers
This commit is contained in:
parent
5ad7f9acfc
commit
ad579dcef6
1 changed files with 4 additions and 13 deletions
|
|
@ -124,7 +124,7 @@
|
|||
whose names are inconsistent. */
|
||||
|
||||
# if !defined _LIBC && !defined getenv
|
||||
extern char *getenv ();
|
||||
extern char *getenv (const char*);
|
||||
# endif
|
||||
|
||||
# ifndef errno
|
||||
|
|
@ -135,9 +135,7 @@ extern int errno;
|
|||
|
||||
# if !defined HAVE___STRCHRNUL && !defined _LIBC
|
||||
static 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 +157,7 @@ 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)
|
||||
{
|
||||
register const char *p = pattern, *n = string;
|
||||
register unsigned char c;
|
||||
|
|
@ -481,10 +475,7 @@ 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);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue