Cygwin: (mostly) drop NT4 and Samba < 3.0 support
[newlib-cygwin.git] / winsup / cygwin / glob_pattern_p.cc
blobe8f42519bc900a2517975f00b38428f3b117c2ea
1 /* glob_pattern_p.c
3 int glob_pattern_p (__const char *__pattern, int __quote)
5 Return nonzero if PATTERN contains any metacharacters.
6 Metacharacters can be quoted with backslashes if QUOTE is nonzero.
8 This function is not part of the interface specified by POSIX.2
9 but several programs want to use it. */
11 #include <string.h>
13 extern "C" {
15 int glob_pattern_p (const char *pattern, int quote)
17 const char *quote_chars = "\\?*[]";
18 if (!quote)
19 quote_chars++;
20 while ((pattern = strpbrk (pattern, quote_chars)) != NULL)
21 if (*pattern == '\\')
22 pattern++;
23 else
24 return true;
25 return false;
28 } /* extern "C" */