]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib: Add wildcard_is_literal to check if a mask has * or ?
authorJosef 'Jeff' Sipek <jeff.sipek@open-xchange.com>
Fri, 30 Apr 2021 18:09:10 +0000 (14:09 -0400)
committeraki.tuomi <aki.tuomi@open-xchange.com>
Mon, 10 May 2021 11:42:42 +0000 (11:42 +0000)
src/lib/wildcard-match.h

index cda9fd84ce35bf38b9b69ab083b21446057aa677..bfe6076f1dd0d77dd0e7d1e98fc548d8e1694670 100644 (file)
@@ -6,4 +6,10 @@ bool wildcard_match(const char *data, const char *mask);
 /* Like wildcard_match(), but match ASCII characters case-insensitively. */
 bool wildcard_match_icase(const char *data, const char *mask);
 
+/* Returns TRUE if mask does *not* contain any '*' or '?' wildcards. */
+static inline bool wildcard_is_literal(const char *mask)
+{
+       return strpbrk(mask, "*?") == NULL;
+}
+
 #endif