Skip to content

Commit ad579dc

Browse files
committed
Modernize fnmatch implementation to avoid warnings with new compilers
1 parent 5ad7f9a commit ad579dc

File tree

1 file changed

+4
-13
lines changed

1 file changed

+4
-13
lines changed

cmdline/fnmatch.c

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@
124124
whose names are inconsistent. */
125125

126126
# if !defined _LIBC && !defined getenv
127-
extern char *getenv ();
127+
extern char *getenv (const char*);
128128
# endif
129129

130130
# ifndef errno
@@ -135,9 +135,7 @@ extern int errno;
135135

136136
# if !defined HAVE___STRCHRNUL && !defined _LIBC
137137
static char *
138-
__strchrnul (s, c)
139-
const char *s;
140-
int c;
138+
__strchrnul (const char *s, int c)
141139
{
142140
char *result = strchr (s, c);
143141
if (result == NULL)
@@ -159,11 +157,7 @@ static int internal_fnmatch __P ((const char *pattern, const char *string,
159157
internal_function;
160158
static int
161159
internal_function
162-
internal_fnmatch (pattern, string, no_leading_period, flags)
163-
const char *pattern;
164-
const char *string;
165-
int no_leading_period;
166-
int flags;
160+
internal_fnmatch (const char *pattern, const char *string, int no_leading_period, int flags)
167161
{
168162
register const char *p = pattern, *n = string;
169163
register unsigned char c;
@@ -481,10 +475,7 @@ internal_fnmatch (pattern, string, no_leading_period, flags)
481475

482476

483477
int
484-
fnmatch (pattern, string, flags)
485-
const char *pattern;
486-
const char *string;
487-
int flags;
478+
fnmatch (const char *pattern, const char *string, int flags)
488479
{
489480
return internal_fnmatch (pattern, string, flags & FNM_PERIOD, flags);
490481
}

0 commit comments

Comments
 (0)