From 1d69c0d63f4ea07398b4a88ee23aad494d3d679d Mon Sep 17 00:00:00 2001 From: "Todd C. Miller" Date: Thu, 30 Aug 2007 20:15:48 +0000 Subject: [PATCH] Replace has_meta() with a macro that calls strpbrk(). --- match.c | 21 ++------------------- 1 file changed, 2 insertions(+), 19 deletions(-) diff --git a/match.c b/match.c index 0597dfc99..7dd8a6552 100644 --- a/match.c +++ b/match.c @@ -94,9 +94,9 @@ __unused static const char rcsid[] = "$Sudo$"; #endif /* lint */ /* - * Prototypes + * Returns TRUE if string 's' contains meta characters. */ -static int has_meta __P((char *)); +#define has_meta(s) (strpbrk(s, "\\?*[]") != NULL) /* * Check for user described by pw in a list of members. @@ -715,20 +715,3 @@ netgr_matches(netgr, lhost, shost, user) return(FALSE); } - -/* - * Returns TRUE if "s" has shell meta characters in it, - * else returns FALSE. - */ -static int -has_meta(s) - char *s; -{ - char *t; - - for (t = s; *t; t++) { - if (*t == '\\' || *t == '?' || *t == '*' || *t == '[' || *t == ']') - return(TRUE); - } - return(FALSE); -} -- 2.40.0