usr.bin/make: remove redundant parentheses around return
This commit is contained in:
parent
6bcabb95b0
commit
e8c43cef44
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: str.c,v 1.44 2020/06/13 07:36:07 rillig Exp $ */
|
||||
/* $NetBSD: str.c,v 1.45 2020/06/13 07:48:59 rillig Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1988, 1989, 1990, 1993
|
||||
@ -69,14 +69,14 @@
|
||||
*/
|
||||
|
||||
#ifndef MAKE_NATIVE
|
||||
static char rcsid[] = "$NetBSD: str.c,v 1.44 2020/06/13 07:36:07 rillig Exp $";
|
||||
static char rcsid[] = "$NetBSD: str.c,v 1.45 2020/06/13 07:48:59 rillig Exp $";
|
||||
#else
|
||||
#include <sys/cdefs.h>
|
||||
#ifndef lint
|
||||
#if 0
|
||||
static char sccsid[] = "@(#)str.c 5.8 (Berkeley) 6/1/90";
|
||||
#else
|
||||
__RCSID("$NetBSD: str.c,v 1.44 2020/06/13 07:36:07 rillig Exp $");
|
||||
__RCSID("$NetBSD: str.c,v 1.45 2020/06/13 07:48:59 rillig Exp $");
|
||||
#endif
|
||||
#endif /* not lint */
|
||||
#endif
|
||||
@ -119,7 +119,7 @@ str_concat(const char *s1, const char *s2, int flags)
|
||||
/* copy second string plus EOS into place */
|
||||
memcpy(result + len1, s2, len2 + 1);
|
||||
|
||||
return(result);
|
||||
return result;
|
||||
}
|
||||
|
||||
/*-
|
||||
@ -344,9 +344,9 @@ Str_Match(const char *string, const char *pattern)
|
||||
* pattern but not at the end of the string, we failed.
|
||||
*/
|
||||
if (*pattern == 0)
|
||||
return(!*string);
|
||||
return !*string;
|
||||
if (*string == 0 && *pattern != '*')
|
||||
return(0);
|
||||
return 0;
|
||||
/*
|
||||
* Check for a "*" as the next pattern character. It matches
|
||||
* any substring. We handle this by calling ourselves
|
||||
@ -356,13 +356,13 @@ Str_Match(const char *string, const char *pattern)
|
||||
if (*pattern == '*') {
|
||||
pattern++;
|
||||
if (*pattern == 0)
|
||||
return(1);
|
||||
return 1;
|
||||
while (*string != 0) {
|
||||
if (Str_Match(string, pattern))
|
||||
return(1);
|
||||
return 1;
|
||||
++string;
|
||||
}
|
||||
return(0);
|
||||
return 0;
|
||||
}
|
||||
/*
|
||||
* Check for a "?" as the next pattern character. It matches
|
||||
@ -388,14 +388,14 @@ Str_Match(const char *string, const char *pattern)
|
||||
if ((*pattern == ']') || (*pattern == 0)) {
|
||||
if (nomatch)
|
||||
break;
|
||||
return(0);
|
||||
return 0;
|
||||
}
|
||||
if (*pattern == *string)
|
||||
break;
|
||||
if (pattern[1] == '-') {
|
||||
c2 = pattern[2];
|
||||
if (c2 == 0)
|
||||
return(nomatch);
|
||||
return nomatch;
|
||||
if ((*pattern <= *string) &&
|
||||
(c2 >= *string))
|
||||
break;
|
||||
@ -421,14 +421,14 @@ Str_Match(const char *string, const char *pattern)
|
||||
if (*pattern == '\\') {
|
||||
++pattern;
|
||||
if (*pattern == 0)
|
||||
return(0);
|
||||
return 0;
|
||||
}
|
||||
/*
|
||||
* There's no special character. Just make sure that the
|
||||
* next characters of each string match.
|
||||
*/
|
||||
if (*pattern != *string)
|
||||
return(0);
|
||||
return 0;
|
||||
thisCharOK: ++pattern;
|
||||
++string;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user