MCPcopy Index your code
hub / github.com/RsyncProject/rsync / glob_pattern_p

Function glob_pattern_p

popt/poptconfig.c:27–52  ·  view source on GitHub ↗

Return nonzero if PATTERN contains any metacharacters. Metacharacters can be quoted with backslashes if QUOTE is nonzero. */

Source from the content-addressed store, hash-verified

25/* Return nonzero if PATTERN contains any metacharacters.
26 Metacharacters can be quoted with backslashes if QUOTE is nonzero. */
27static int
28glob_pattern_p (const char * pattern, int quote)
29{
30 const char * p;
31 int open = 0;
32
33 for (p = pattern; *p != '\0'; ++p)
34 switch (*p) {
35 case '?':
36 case '*':
37 return 1;
38 break;
39 case '\\':
40 if (quote && p[1] != '\0')
41 ++p;
42 break;
43 case '[':
44 open = 1;
45 break;
46 case ']':
47 if (open)
48 return 1;
49 break;
50 }
51 return 0;
52}
53#endif /* !defined(__GLIBC__) */
54
55static int poptGlobFlags = 0;

Callers 2

poptGlobFunction · 0.85
configAppMatchFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected