OpenCoverage

glob_loop.c

Absolute File Name:/home/opencoverage/opencoverage/guest-scripts/bash/src/lib/glob/glob_loop.c
Source codeSwitch to Preprocessed file
LineSourceCount
1/* Copyright (C) 1991-2017 Free Software Foundation, Inc.-
2-
3 This file is part of GNU Bash, the Bourne Again SHell.-
4 -
5 Bash is free software: you can redistribute it and/or modify-
6 it under the terms of the GNU General Public License as published by-
7 the Free Software Foundation, either version 3 of the License, or-
8 (at your option) any later version.-
9-
10 Bash is distributed in the hope that it will be useful,-
11 but WITHOUT ANY WARRANTY; without even the implied warranty of-
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the-
13 GNU General Public License for more details.-
14-
15 You should have received a copy of the GNU General Public License-
16 along with Bash. If not, see <http://www.gnu.org/licenses/>.-
17*/-
18-
19static int INTERNAL_GLOB_PATTERN_P __P((const GCHAR *));-
20-
21/* Return nonzero if PATTERN has any special globbing chars in it.-
22 Compiled twice, once each for single-byte and multibyte characters. */-
23static int-
24INTERNAL_GLOB_PATTERN_P (pattern)-
25 const GCHAR *pattern;-
26{-
27 register const GCHAR *p;-
28 register GCHAR c;-
29 int bopen;-
30-
31 p = pattern;-
32 bopen = 0;-
33-
34 while ((c = *p++) != L('\0'))
(c = *p++) != '\0'Description
TRUEevaluated 2766 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 274 times by 1 test
Evaluated by:
  • Self test
(c = *p++) != L'\0'Description
TRUEevaluated 6829 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 159 times by 1 test
Evaluated by:
  • Self test
159-6829
35 switch (c)-
36 {-
37 case L('?'):
never executed: case '?':
executed 14 times by 1 test: case L'?':
Executed by:
  • Self test
0-14
38 case L('*'):
executed 883 times by 1 test: case '*':
Executed by:
  • Self test
executed 197 times by 1 test: case L'*':
Executed by:
  • Self test
197-883
39 return 1;
executed 883 times by 1 test: return 1;
Executed by:
  • Self test
executed 211 times by 1 test: return 1;
Executed by:
  • Self test
211-883
40-
41 case L('['): /* Only accept an open brace if there is a close */
executed 16 times by 1 test: case '[':
Executed by:
  • Self test
executed 728 times by 1 test: case L'[':
Executed by:
  • Self test
16-728
42 bopen++; /* brace to match it. Bracket expressions must be */-
43 continue; /* complete, according to Posix.2 */
executed 16 times by 1 test: continue;
Executed by:
  • Self test
executed 728 times by 1 test: continue;
Executed by:
  • Self test
16-728
44 case L(']'):
executed 16 times by 1 test: case ']':
Executed by:
  • Self test
executed 700 times by 1 test: case L']':
Executed by:
  • Self test
16-700
45 if (bopen)
bopenDescription
TRUEevaluated 16 times by 1 test
Evaluated by:
  • Self test
FALSEnever evaluated
bopenDescription
TRUEevaluated 700 times by 1 test
Evaluated by:
  • Self test
FALSEnever evaluated
0-700
46 return 1;
executed 16 times by 1 test: return 1;
Executed by:
  • Self test
executed 700 times by 1 test: return 1;
Executed by:
  • Self test
16-700
47 continue;
never executed: continue;
never executed: continue;
0
48-
49 case L('+'): /* extended matching operators */
never executed: case '+':
executed 11 times by 1 test: case L'+':
Executed by:
  • Self test
0-11
50 case L('@'):
executed 7 times by 1 test: case '@':
Executed by:
  • Self test
executed 19 times by 1 test: case L'@':
Executed by:
  • Self test
7-19
51 case L('!'):
executed 18 times by 1 test: case '!':
Executed by:
  • Self test
executed 8 times by 1 test: case L'!':
Executed by:
  • Self test
8-18
52 if (*p == L('(')) /*) */
*p == '('Description
TRUEevaluated 12 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 13 times by 1 test
Evaluated by:
  • Self test
*p == L'('Description
TRUEevaluated 25 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 13 times by 1 test
Evaluated by:
  • Self test
12-25
53 return 1;
executed 12 times by 1 test: return 1;
Executed by:
  • Self test
executed 25 times by 1 test: return 1;
Executed by:
  • Self test
12-25
54 continue;
executed 13 times by 1 test: continue;
Executed by:
  • Self test
executed 13 times by 1 test: continue;
Executed by:
  • Self test
13
55-
56 case L('\\'):
executed 6 times by 1 test: case '\\':
Executed by:
  • Self test
executed 34 times by 1 test: case L'\\':
Executed by:
  • Self test
6-34
57 if (*p++ == L('\0'))
*p++ == '\0'Description
TRUEnever evaluated
FALSEevaluated 6 times by 1 test
Evaluated by:
  • Self test
*p++ == L'\0'Description
TRUEnever evaluated
FALSEevaluated 34 times by 1 test
Evaluated by:
  • Self test
0-34
58 return 0;
never executed: return 0;
never executed: return 0;
0
59 }
executed 6 times by 1 test: end of block
Executed by:
  • Self test
executed 34 times by 1 test: end of block
Executed by:
  • Self test
6-34
60-
61 return 0;
executed 274 times by 1 test: return 0;
Executed by:
  • Self test
executed 159 times by 1 test: return 0;
Executed by:
  • Self test
159-274
62}-
63-
64#undef INTERNAL_GLOB_PATTERN_P-
65#undef L-
66#undef INT-
67#undef CHAR-
68#undef GCHAR-
Source codeSwitch to Preprocessed file

Generated by Squish Coco 4.1.2