Absolute File Name: | /home/opencoverage/opencoverage/guest-scripts/bash/src/lib/glob/gm_loop.c |
Source code | Switch to Preprocessed file |
Line | Source | Count | ||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
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 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
19 | #if EXTENDED_GLOB | - | ||||||||||||||||||||||||||||||||||||||||||||||||
20 | int | - | ||||||||||||||||||||||||||||||||||||||||||||||||
21 | EXTGLOB_PATTERN_P (pat) | - | ||||||||||||||||||||||||||||||||||||||||||||||||
22 | const CHAR *pat; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
23 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||
24 | switch (pat[0]) | - | ||||||||||||||||||||||||||||||||||||||||||||||||
25 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||
26 | case L('*'): executed 46858 times by 1 test: case '*': Executed by:
never executed: case L'*': | 0-46858 | ||||||||||||||||||||||||||||||||||||||||||||||||
27 | case L('+'): executed 32 times by 1 test: case '+': Executed by:
never executed: case L'+': | 0-32 | ||||||||||||||||||||||||||||||||||||||||||||||||
28 | case L('!'): executed 84 times by 1 test: case '!': Executed by:
never executed: case L'!': | 0-84 | ||||||||||||||||||||||||||||||||||||||||||||||||
29 | case L('@'): executed 2240 times by 1 test: case '@': Executed by:
never executed: case L'@': | 0-2240 | ||||||||||||||||||||||||||||||||||||||||||||||||
30 | case L('?'): executed 3364 times by 1 test: case '?': Executed by:
never executed: case L'?': | 0-3364 | ||||||||||||||||||||||||||||||||||||||||||||||||
31 | return (pat[1] == L('(')); /* ) */ executed 52578 times by 1 test: return (pat[1] == '('); Executed by:
never executed: return (pat[1] == L'('); | 0-52578 | ||||||||||||||||||||||||||||||||||||||||||||||||
32 | default: executed 933804 times by 1 test: default: Executed by:
never executed: default: | 0-933804 | ||||||||||||||||||||||||||||||||||||||||||||||||
33 | return 0; executed 933804 times by 1 test: return 0; Executed by:
never executed: return 0; | 0-933804 | ||||||||||||||||||||||||||||||||||||||||||||||||
34 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||
35 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
36 | return 0; dead code: return 0; dead code: return 0; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
37 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||
38 | #endif | - | ||||||||||||||||||||||||||||||||||||||||||||||||
39 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
40 | /* Return 1 of the first character of STRING could match the first | - | ||||||||||||||||||||||||||||||||||||||||||||||||
41 | character of pattern PAT. Compiled to both single and wiide character | - | ||||||||||||||||||||||||||||||||||||||||||||||||
42 | versions. FLAGS is a subset of strmatch flags; used to do case-insensitive | - | ||||||||||||||||||||||||||||||||||||||||||||||||
43 | matching for now. */ | - | ||||||||||||||||||||||||||||||||||||||||||||||||
44 | int | - | ||||||||||||||||||||||||||||||||||||||||||||||||
45 | MATCH_PATTERN_CHAR (pat, string, flags) | - | ||||||||||||||||||||||||||||||||||||||||||||||||
46 | CHAR *pat, *string; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
47 | int flags; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
48 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||
49 | CHAR c; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
50 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
51 | if (*string == 0)
| 0-94174 | ||||||||||||||||||||||||||||||||||||||||||||||||
52 | return (*pat == L('*')); /* XXX - allow only * to match empty string */ executed 18 times by 1 test: return (*pat == '*'); Executed by:
never executed: return (*pat == L'*'); | 0-18 | ||||||||||||||||||||||||||||||||||||||||||||||||
53 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
54 | switch (c = *pat++) | - | ||||||||||||||||||||||||||||||||||||||||||||||||
55 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||
56 | default: executed 17893 times by 1 test: default: Executed by:
executed 2 times by 1 test: default: Executed by:
| 2-17893 | ||||||||||||||||||||||||||||||||||||||||||||||||
57 | return (FOLD(*string) == FOLD(c)); executed 17893 times by 1 test: return (((flags & (1 << 4)) ? ((1 && ((*__ctype_b_loc ())[(int) (( (unsigned char)(unsigned char)*string ))] & (unsigned short int) _ISupper) ) ? (__extension__ ({ int __res; if (sizeof ( (unsigned char)*string ) > 1) { if (__builtin_constant_p ( (unsigne...d char)c ); __res = __c < -128 || __c > 255 ? __c : (*__ctype_tolower_loc ())[__c]; } else __res = tolower ( (unsigned char)c ); } else __res = (*__ctype_tolower_loc ())[(int) ( (unsigned char)c )]; __res; })) : ((unsigned char)c)) : ((unsigned char)c))); Executed by:
never executed: end of block never executed: __res = tolower ( (unsigned char)*string ); never executed: __res = (*__ctype_tolower_loc ())[(int) ( (unsigned char)*string )]; never executed: end of block never executed: __res = tolower ( (unsigned char)c ); executed 6 times by 1 test: __res = (*__ctype_tolower_loc ())[(int) ( (unsigned char)c )]; Executed by:
executed 2 times by 1 test: return (((flags & (1 << 4)) && iswupper (*string) ? towlower (*string) : (*string)) == ((flags & (1 << 4)) && iswupper (c) ? towlower (c) : (c))); Executed by:
| 0-17893 | ||||||||||||||||||||||||||||||||||||||||||||||||
58 | case L('\\'): executed 486 times by 1 test: case '\\': Executed by:
never executed: case L'\\': | 0-486 | ||||||||||||||||||||||||||||||||||||||||||||||||
59 | return (FOLD(*string) == FOLD(*pat)); executed 486 times by 1 test: return (((flags & (1 << 4)) ? ((1 && ((*__ctype_b_loc ())[(int) (( (unsigned char)(unsigned char)*string ))] & (unsigned short int) _ISupper) ) ? (__extension__ ({ int __res; if (sizeof ( (unsigned char)*string ) > 1) { if (__builtin_constant_p ( (unsigne...__res = __c < -128 || __c > 255 ? __c : (*__ctype_tolower_loc ())[__c]; } else __res = tolower ( (unsigned char)*pat ); } else __res = (*__ctype_tolower_loc ())[(int) ( (unsigned char)*pat )]; __res; })) : ((unsigned char)*pat)) : ((unsigned char)*pat))); Executed by:
never executed: end of block never executed: __res = tolower ( (unsigned char)*string ); never executed: __res = (*__ctype_tolower_loc ())[(int) ( (unsigned char)*string )]; never executed: end of block never executed: __res = tolower ( (unsigned char)*pat ); never executed: __res = (*__ctype_tolower_loc ())[(int) ( (unsigned char)*pat )]; never executed: return (((flags & (1 << 4)) && iswupper (*string) ? towlower (*string) : (*string)) == ((flags & (1 << 4)) && iswupper (*pat) ? towlower (*pat) : (*pat)));
| 0-486 | ||||||||||||||||||||||||||||||||||||||||||||||||
60 | case L('?'): executed 16094 times by 1 test: case '?': Executed by:
never executed: case L'?': | 0-16094 | ||||||||||||||||||||||||||||||||||||||||||||||||
61 | return (*pat == L('(') ? 1 : (*string != L'\0')); executed 16094 times by 1 test: return (*pat == '(' ? 1 : (*string != L'\0')); Executed by:
never executed: return (*pat == L'(' ? 1 : (*string != L'\0')); | 0-16094 | ||||||||||||||||||||||||||||||||||||||||||||||||
62 | case L('*'): executed 193 times by 1 test: case '*': Executed by:
never executed: case L'*': | 0-193 | ||||||||||||||||||||||||||||||||||||||||||||||||
63 | return (1); executed 193 times by 1 test: return (1); Executed by:
never executed: return (1); | 0-193 | ||||||||||||||||||||||||||||||||||||||||||||||||
64 | case L('+'): never executed: case '+': never executed: case L'+': | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
65 | case L('!'): never executed: case '!': never executed: case L'!': | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
66 | case L('@'): never executed: case '@': never executed: case L'@': | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
67 | return (*pat == L('(') ? 1 : (FOLD(*string) == FOLD(c))); never executed: return (*pat == '(' ? 1 : (((flags & (1 << 4)) ? ((1 && ((*__ctype_b_loc ())[(int) (( (unsigned char)(unsigned char)*string ))] & (unsigned short int) _ISupper) ) ? (__extension__ ({ int __res; if (sizeof ( (unsigned char)*string ) > 1) { if (__builtin_co... char)c ); __res = __c < -128 || __c > 255 ? __c : (*__ctype_tolower_loc ())[__c]; } else __res = tolower ( (unsigned char)c ); } else __res = (*__ctype_tolower_loc ())[(int) ( (unsigned char)c )]; __res; })) : ((unsigned char)c)) : ((unsigned char)c)))); never executed: end of block never executed: __res = tolower ( (unsigned char)*string ); never executed: __res = (*__ctype_tolower_loc ())[(int) ( (unsigned char)*string )]; never executed: end of block never executed: __res = tolower ( (unsigned char)c ); never executed: __res = (*__ctype_tolower_loc ())[(int) ( (unsigned char)c )]; never executed: return (*pat == L'(' ? 1 : (((flags & (1 << 4)) && iswupper (*string) ? towlower (*string) : (*string)) == ((flags & (1 << 4)) && iswupper (c) ? towlower (c) : (c))));
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
68 | case L('['): executed 59508 times by 1 test: case '[': Executed by:
never executed: case L'[': | 0-59508 | ||||||||||||||||||||||||||||||||||||||||||||||||
69 | return (*string != L('\0')); executed 59508 times by 1 test: return (*string != '\0'); Executed by:
never executed: return (*string != L'\0'); | 0-59508 | ||||||||||||||||||||||||||||||||||||||||||||||||
70 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||
71 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||
72 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
73 | int | - | ||||||||||||||||||||||||||||||||||||||||||||||||
74 | MATCHLEN (pat, max) | - | ||||||||||||||||||||||||||||||||||||||||||||||||
75 | CHAR *pat; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
76 | size_t max; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
77 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||
78 | CHAR c; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
79 | int matlen, bracklen, t, in_cclass, in_collsym, in_equiv; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
80 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
81 | if (*pat == 0)
| 0-59359 | ||||||||||||||||||||||||||||||||||||||||||||||||
82 | return (0); never executed: return (0); never executed: return (0); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
83 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
84 | matlen = in_cclass = in_collsym = in_equiv = 0; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
85 | while (c = *pat++)
| 7-68045 | ||||||||||||||||||||||||||||||||||||||||||||||||
86 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||
87 | switch (c) | - | ||||||||||||||||||||||||||||||||||||||||||||||||
88 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||
89 | default: executed 11173 times by 1 test: default: Executed by:
executed 14 times by 1 test: default: Executed by:
| 14-11173 | ||||||||||||||||||||||||||||||||||||||||||||||||
90 | matlen++; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
91 | break; executed 11173 times by 1 test: break; Executed by:
executed 14 times by 1 test: break; Executed by:
| 14-11173 | ||||||||||||||||||||||||||||||||||||||||||||||||
92 | case L('\\'): executed 197 times by 1 test: case '\\': Executed by:
never executed: case L'\\': | 0-197 | ||||||||||||||||||||||||||||||||||||||||||||||||
93 | if (*pat == 0)
| 0-197 | ||||||||||||||||||||||||||||||||||||||||||||||||
94 | return ++matlen; never executed: return ++matlen; never executed: return ++matlen; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
95 | else | - | ||||||||||||||||||||||||||||||||||||||||||||||||
96 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||
97 | matlen++; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
98 | pat++; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
99 | } executed 197 times by 1 test: end of block Executed by:
never executed: end of block | 0-197 | ||||||||||||||||||||||||||||||||||||||||||||||||
100 | break; executed 197 times by 1 test: break; Executed by:
never executed: break; | 0-197 | ||||||||||||||||||||||||||||||||||||||||||||||||
101 | case L('?'): executed 2928 times by 1 test: case '?': Executed by:
never executed: case L'?': | 0-2928 | ||||||||||||||||||||||||||||||||||||||||||||||||
102 | if (*pat == LPAREN)
| 0-2928 | ||||||||||||||||||||||||||||||||||||||||||||||||
103 | return (matlen = -1); /* XXX for now */ never executed: return (matlen = -1); never executed: return (matlen = -1); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
104 | else | - | ||||||||||||||||||||||||||||||||||||||||||||||||
105 | matlen++; executed 2928 times by 1 test: matlen++; Executed by:
never executed: matlen++; | 0-2928 | ||||||||||||||||||||||||||||||||||||||||||||||||
106 | break; executed 2928 times by 1 test: break; Executed by:
never executed: break; | 0-2928 | ||||||||||||||||||||||||||||||||||||||||||||||||
107 | case L('*'): executed 295 times by 1 test: case '*': Executed by:
never executed: case L'*': | 0-295 | ||||||||||||||||||||||||||||||||||||||||||||||||
108 | return (matlen = -1); executed 295 times by 1 test: return (matlen = -1); Executed by:
never executed: return (matlen = -1); | 0-295 | ||||||||||||||||||||||||||||||||||||||||||||||||
109 | case L('+'): never executed: case '+': never executed: case L'+': | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
110 | case L('!'): never executed: case '!': never executed: case L'!': | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
111 | case L('@'): never executed: case '@': never executed: case L'@': | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
112 | if (*pat == LPAREN)
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
113 | return (matlen = -1); /* XXX for now */ never executed: return (matlen = -1); never executed: return (matlen = -1); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
114 | else | - | ||||||||||||||||||||||||||||||||||||||||||||||||
115 | matlen++; never executed: matlen++; never executed: matlen++; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
116 | break; never executed: break; never executed: break; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
117 | case L('['): executed 53452 times by 1 test: case '[': Executed by:
never executed: case L'[': | 0-53452 | ||||||||||||||||||||||||||||||||||||||||||||||||
118 | /* scan for ending `]', skipping over embedded [:...:] */ | - | ||||||||||||||||||||||||||||||||||||||||||||||||
119 | bracklen = 1; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
120 | c = *pat++; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
121 | do | - | ||||||||||||||||||||||||||||||||||||||||||||||||
122 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||
123 | if (c == 0)
| 0-213647 | ||||||||||||||||||||||||||||||||||||||||||||||||
124 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||
125 | pat--; /* back up to NUL */ | - | ||||||||||||||||||||||||||||||||||||||||||||||||
126 | matlen += bracklen; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
127 | goto bad_bracket; executed 3 times by 1 test: goto bad_bracket; Executed by:
never executed: goto bad_bracket; | 0-3 | ||||||||||||||||||||||||||||||||||||||||||||||||
128 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||
129 | else if (c == L('\\'))
| 0-213599 | ||||||||||||||||||||||||||||||||||||||||||||||||
130 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||
131 | /* *pat == backslash-escaped character */ | - | ||||||||||||||||||||||||||||||||||||||||||||||||
132 | bracklen++; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
133 | /* If the backslash or backslash-escape ends the string, | - | ||||||||||||||||||||||||||||||||||||||||||||||||
134 | bail. The ++pat skips over the backslash escape */ | - | ||||||||||||||||||||||||||||||||||||||||||||||||
135 | if (*pat == 0 || *++pat == 0)
| 0-48 | ||||||||||||||||||||||||||||||||||||||||||||||||
136 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||
137 | matlen += bracklen; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
138 | goto bad_bracket; executed 1 time by 1 test: goto bad_bracket; Executed by:
never executed: goto bad_bracket; | 0-1 | ||||||||||||||||||||||||||||||||||||||||||||||||
139 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||
140 | } executed 47 times by 1 test: end of block Executed by:
never executed: end of block | 0-47 | ||||||||||||||||||||||||||||||||||||||||||||||||
141 | else if (c == L('[') && *pat == L(':')) /* character class */
| 0-195801 | ||||||||||||||||||||||||||||||||||||||||||||||||
142 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||
143 | pat++; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
144 | bracklen++; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
145 | in_cclass = 1; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
146 | } executed 17798 times by 1 test: end of block Executed by:
never executed: end of block | 0-17798 | ||||||||||||||||||||||||||||||||||||||||||||||||
147 | else if (in_cclass && c == L(':') && *pat == L(']'))
| 0-106785 | ||||||||||||||||||||||||||||||||||||||||||||||||
148 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||
149 | pat++; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
150 | bracklen++; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
151 | in_cclass = 0; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
152 | } executed 17795 times by 1 test: end of block Executed by:
never executed: end of block | 0-17795 | ||||||||||||||||||||||||||||||||||||||||||||||||
153 | else if (c == L('[') && *pat == L('.')) /* collating symbol */
| 0-178006 | ||||||||||||||||||||||||||||||||||||||||||||||||
154 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||
155 | pat++; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
156 | bracklen++; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
157 | if (*pat == L(']')) /* right bracket can appear as collating symbol */
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
158 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||
159 | pat++; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
160 | bracklen++; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
161 | } never executed: end of block never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
162 | in_collsym = 1; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
163 | } never executed: end of block never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
164 | else if (in_collsym && c == L('.') && *pat == L(']'))
| 0-178006 | ||||||||||||||||||||||||||||||||||||||||||||||||
165 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||
166 | pat++; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
167 | bracklen++; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
168 | in_collsym = 0; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
169 | } never executed: end of block never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
170 | else if (c == L('[') && *pat == L('=')) /* equivalence class */
| 0-178006 | ||||||||||||||||||||||||||||||||||||||||||||||||
171 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||
172 | pat++; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
173 | bracklen++; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
174 | if (*pat == L(']')) /* right bracket can appear as equivalence class */
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
175 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||
176 | pat++; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
177 | bracklen++; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
178 | } never executed: end of block never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
179 | in_equiv = 1; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
180 | } never executed: end of block never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
181 | else if (in_equiv && c == L('=') && *pat == L(']'))
| 0-178006 | ||||||||||||||||||||||||||||||||||||||||||||||||
182 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||
183 | pat++; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
184 | bracklen++; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
185 | in_equiv = 0; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
186 | } never executed: end of block never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
187 | else | - | ||||||||||||||||||||||||||||||||||||||||||||||||
188 | bracklen++; executed 178006 times by 1 test: bracklen++; Executed by:
never executed: bracklen++; | 0-178006 | ||||||||||||||||||||||||||||||||||||||||||||||||
189 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||
190 | while ((c = *pat++) != L(']'));
| 0-160198 | ||||||||||||||||||||||||||||||||||||||||||||||||
191 | matlen++; /* bracket expression can only match one char */ | - | ||||||||||||||||||||||||||||||||||||||||||||||||
192 | bad_bracket: code before this statement executed 53448 times by 1 test: bad_bracket: Executed by:
code before this statement never executed: bad_bracket: | 0-53448 | ||||||||||||||||||||||||||||||||||||||||||||||||
193 | break; executed 53452 times by 1 test: break; Executed by:
never executed: break; | 0-53452 | ||||||||||||||||||||||||||||||||||||||||||||||||
194 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||
195 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||
196 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
197 | return matlen; executed 59064 times by 1 test: return matlen; Executed by:
executed 7 times by 1 test: return matlen; Executed by:
| 7-59064 | ||||||||||||||||||||||||||||||||||||||||||||||||
198 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||
199 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
200 | #undef EXTGLOB_PATTERN_P | - | ||||||||||||||||||||||||||||||||||||||||||||||||
201 | #undef MATCH_PATTERN_CHAR | - | ||||||||||||||||||||||||||||||||||||||||||||||||
202 | #undef MATCHLEN | - | ||||||||||||||||||||||||||||||||||||||||||||||||
203 | #undef FOLD | - | ||||||||||||||||||||||||||||||||||||||||||||||||
204 | #undef L | - | ||||||||||||||||||||||||||||||||||||||||||||||||
205 | #undef LPAREN | - | ||||||||||||||||||||||||||||||||||||||||||||||||
206 | #undef RPAREN | - | ||||||||||||||||||||||||||||||||||||||||||||||||
207 | #undef INT | - | ||||||||||||||||||||||||||||||||||||||||||||||||
208 | #undef CHAR | - | ||||||||||||||||||||||||||||||||||||||||||||||||
Source code | Switch to Preprocessed file |