OSDN Git Service

* exceptions.cc (_cygtls::call_signal_handler): Fix debugging to not go to
[pf3gnuchains/pf3gnuchains4x.git] / winsup / cygwin / glob_pattern_p.cc
1 /* glob_pattern_p.c
2
3    int glob_pattern_p (__const char *__pattern, int __quote)
4
5    Return nonzero if PATTERN contains any metacharacters.
6    Metacharacters can be quoted with backslashes if QUOTE is nonzero.
7
8    This function is not part of the interface specified by POSIX.2
9    but several programs want to use it.  */
10
11 #include <string.h>
12
13 extern "C" {
14
15 int glob_pattern_p (const char *pattern, int quote)
16 {
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;
26 }
27
28 } /* extern "C" */