OpenCoverage

pathexp.c

Absolute File Name:/home/opencoverage/opencoverage/guest-scripts/bash/src/pathexp.c
Switch to Source codePreprocessed file
LineSourceCount
1-
2-
3-
4-
5-
6-
7-
8-
9-
10static int glob_name_is_acceptable (const char *);-
11static void ignore_globbed_names (char **, sh_ignore_func_t *);-
12static char *split_ignorespec (char *, int *);-
13-
14-
15-
16-
17-
18-
19-
20-
21int glob_dot_filenames;-
22-
23-
24int extended_glob = 0;-
25-
26-
27int glob_star = 0;-
28-
29-
30int-
31unquoted_glob_pattern_p (string)-
32 register char *string;-
33{-
34 register int c;-
35 char *send;-
36 int open;-
37-
38 mbstate_t state; memset (&state, '\0', sizeof (mbstate_t));-
39-
40 open = 0;-
41 send = string + strlen (string);-
42-
43 while (c = *string++
c = *string++Description
TRUEevaluated 196256284 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 62402102 times by 1 test
Evaluated by:
  • Self test
)
62402102-196256284
44 {-
45 switch (c)-
46 {-
47 case
executed 13 times by 1 test: case '?':
Executed by:
  • Self test
'?':
executed 13 times by 1 test: case '?':
Executed by:
  • Self test
13
48 case
executed 152 times by 1 test: case '*':
Executed by:
  • Self test
'*':
executed 152 times by 1 test: case '*':
Executed by:
  • Self test
152
49 return
executed 165 times by 1 test: return (1);
Executed by:
  • Self test
(1);
executed 165 times by 1 test: return (1);
Executed by:
  • Self test
165
50-
51 case
executed 4455 times by 1 test: case '[':
Executed by:
  • Self test
'[':
executed 4455 times by 1 test: case '[':
Executed by:
  • Self test
4455
52 open++;-
53 continue;
executed 4455 times by 1 test: continue;
Executed by:
  • Self test
4455
54-
55 case
executed 4428 times by 1 test: case ']':
Executed by:
  • Self test
']':
executed 4428 times by 1 test: case ']':
Executed by:
  • Self test
4428
56 if (open
openDescription
TRUEevaluated 603 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 3825 times by 1 test
Evaluated by:
  • Self test
)
603-3825
57 return
executed 603 times by 1 test: return (1);
Executed by:
  • Self test
(1);
executed 603 times by 1 test: return (1);
Executed by:
  • Self test
603
58 continue;
executed 3825 times by 1 test: continue;
Executed by:
  • Self test
3825
59-
60 case
executed 3381 times by 1 test: case '+':
Executed by:
  • Self test
'+':
executed 3381 times by 1 test: case '+':
Executed by:
  • Self test
3381
61 case
executed 72 times by 1 test: case '@':
Executed by:
  • Self test
'@':
executed 72 times by 1 test: case '@':
Executed by:
  • Self test
72
62 case
executed 1557 times by 1 test: case '!':
Executed by:
  • Self test
'!':
executed 1557 times by 1 test: case '!':
Executed by:
  • Self test
1557
63 if (*
*string == '('Description
TRUEevaluated 37 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 4973 times by 1 test
Evaluated by:
  • Self test
string == '('
*string == '('Description
TRUEevaluated 37 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 4973 times by 1 test
Evaluated by:
  • Self test
)
37-4973
64 return
executed 37 times by 1 test: return (1);
Executed by:
  • Self test
(1);
executed 37 times by 1 test: return (1);
Executed by:
  • Self test
37
65 continue;
executed 4973 times by 1 test: continue;
Executed by:
  • Self test
4973
66-
67 case
executed 49577663 times by 1 test: case '\001':
Executed by:
  • Self test
'\001':
executed 49577663 times by 1 test: case '\001':
Executed by:
  • Self test
49577663
68 case
executed 180 times by 1 test: case '\\':
Executed by:
  • Self test
'\\':
executed 180 times by 1 test: case '\\':
Executed by:
  • Self test
180
69 if (*
*string++ == '\0'Description
TRUEevaluated 82 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 49577761 times by 1 test
Evaluated by:
  • Self test
string++ == '\0'
*string++ == '\0'Description
TRUEevaluated 82 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 49577761 times by 1 test
Evaluated by:
  • Self test
)
82-49577761
70 return
executed 82 times by 1 test: return (0);
Executed by:
  • Self test
(0);
executed 82 times by 1 test: return (0);
Executed by:
  • Self test
82
71 }
executed 49577761 times by 1 test: end of block
Executed by:
  • Self test
49577761
72-
73-
74-
75-
76 string--;-
77 do { if (locale_mb_cur_max > 1
locale_mb_cur_max > 1Description
TRUEevaluated 194693588 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 1548556 times by 1 test
Evaluated by:
  • Self test
) { mbstate_t state_bak; size_t mblength; int _f; _f = is_basic (*(string)); if (_f
_fDescription
TRUEevaluated 190590052 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 4103536 times by 1 test
Evaluated by:
  • Self test
) mblength = 1;
executed 190590052 times by 1 test: mblength = 1;
Executed by:
  • Self test
else { state_bak = state; mblength = mbrlen ((string), (send - string), &state); }
executed 4103536 times by 1 test: end of block
Executed by:
  • Self test
if (mblength == (size_t)-2
mblength == (size_t)-2Description
TRUEevaluated 183 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 194693405 times by 1 test
Evaluated by:
  • Self test
|| mblength == (size_t)-1
mblength == (size_t)-1Description
TRUEevaluated 243 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 194693162 times by 1 test
Evaluated by:
  • Self test
) { state = state_bak; mblength = 1; }
executed 426 times by 1 test: end of block
Executed by:
  • Self test
else (
executed 194693162 times by 1 test: (string) += (mblength < 1) ? 0 : (mblength - 1);
Executed by:
  • Self test
string) += (mblength < 1) ? 0 : (mblength - 1);
executed 194693162 times by 1 test: (string) += (mblength < 1) ? 0 : (mblength - 1);
Executed by:
  • Self test
} } while (0);
183-194693588
78 string++;-
79-
80-
81-
82 }
executed 196242144 times by 1 test: end of block
Executed by:
  • Self test
196242144
83 return
executed 62402102 times by 1 test: return (0);
Executed by:
  • Self test
(0);
executed 62402102 times by 1 test: return (0);
Executed by:
  • Self test
62402102
84}-
85-
86-
87-
88static inline int-
89ere_char (c)-
90 int c;-
91{-
92 switch (c)-
93 {-
94 case
executed 10 times by 1 test: case '.':
Executed by:
  • Self test
'.':
executed 10 times by 1 test: case '.':
Executed by:
  • Self test
10
95 case
executed 18 times by 1 test: case '[':
Executed by:
  • Self test
'[':
executed 18 times by 1 test: case '[':
Executed by:
  • Self test
18
96 case
executed 23 times by 1 test: case '\\':
Executed by:
  • Self test
'\\':
executed 23 times by 1 test: case '\\':
Executed by:
  • Self test
23
97 case
executed 7 times by 1 test: case '(':
Executed by:
  • Self test
'(':
executed 7 times by 1 test: case '(':
Executed by:
  • Self test
7
98 case
executed 7 times by 1 test: case ')':
Executed by:
  • Self test
')':
executed 7 times by 1 test: case ')':
Executed by:
  • Self test
7
99 case
executed 3 times by 1 test: case '*':
Executed by:
  • Self test
'*':
executed 3 times by 1 test: case '*':
Executed by:
  • Self test
3
100 case
never executed: case '+':
'+':
never executed: case '+':
0
101 case
never executed: case '?':
'?':
never executed: case '?':
0
102 case
never executed: case '{':
'{':
never executed: case '{':
0
103 case
never executed: case '|':
'|':
never executed: case '|':
0
104 case
never executed: case '^':
'^':
never executed: case '^':
0
105 case
executed 1 time by 1 test: case '$':
Executed by:
  • Self test
'$':
executed 1 time by 1 test: case '$':
Executed by:
  • Self test
1
106 return
executed 69 times by 1 test: return 1;
Executed by:
  • Self test
1;
executed 69 times by 1 test: return 1;
Executed by:
  • Self test
69
107 default
executed 125 times by 1 test: default:
Executed by:
  • Self test
:
executed 125 times by 1 test: default:
Executed by:
  • Self test
125
108 return
executed 125 times by 1 test: return 0;
Executed by:
  • Self test
0;
executed 125 times by 1 test: return 0;
Executed by:
  • Self test
125
109 }-
110 return
dead code: return (0);
(0);
dead code: return (0);
-
111}-
112-
113int-
114glob_char_p (s)-
115 const char *s;-
116{-
117 switch (*s)-
118 {-
119 case
never executed: case '*':
'*':
never executed: case '*':
0
120 case
executed 1 time by 1 test: case '[':
Executed by:
  • Self test
'[':
executed 1 time by 1 test: case '[':
Executed by:
  • Self test
1
121 case
executed 1 time by 1 test: case ']':
Executed by:
  • Self test
']':
executed 1 time by 1 test: case ']':
Executed by:
  • Self test
1
122 case
never executed: case '?':
'?':
never executed: case '?':
0
123 case
executed 7 times by 1 test: case '\\':
Executed by:
  • Self test
'\\':
executed 7 times by 1 test: case '\\':
Executed by:
  • Self test
7
124 return
executed 9 times by 1 test: return 1;
Executed by:
  • Self test
1;
executed 9 times by 1 test: return 1;
Executed by:
  • Self test
9
125 case
executed 2 times by 1 test: case '+':
Executed by:
  • Self test
'+':
executed 2 times by 1 test: case '+':
Executed by:
  • Self test
2
126 case
never executed: case '@':
'@':
never executed: case '@':
0
127 case
executed 9 times by 1 test: case '!':
Executed by:
  • Self test
'!':
executed 9 times by 1 test: case '!':
Executed by:
  • Self test
9
128 if (s[1] == '('
s[1] == '('Description
TRUEnever evaluated
FALSEevaluated 11 times by 1 test
Evaluated by:
  • Self test
)
0-11
129 return
never executed: return 1;
1;
never executed: return 1;
0
130 break;
executed 11 times by 1 test: break;
Executed by:
  • Self test
11
131 }-
132 return
executed 102 times by 1 test: return 0;
Executed by:
  • Self test
0;
executed 102 times by 1 test: return 0;
Executed by:
  • Self test
102
133}-
134char *-
135quote_string_for_globbing (pathname, qflags)-
136 const char *pathname;-
137 int qflags;-
138{-
139 char *temp;-
140 register int i, j;-
141 int cclass, collsym, equiv, c, last_was_backslash;-
142 int savei, savej;-
143-
144 temp = (char *)sh_xmalloc((2 * strlen (pathname) + 1), "pathexp.c", 189);-
145-
146 if ((
(qflags & 0x01)Description
TRUEevaluated 49171180 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 805 times by 1 test
Evaluated by:
  • Self test
qflags & 0x01)
(qflags & 0x01)Description
TRUEevaluated 49171180 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 805 times by 1 test
Evaluated by:
  • Self test
&& ((
(pathname)[0] == '\177'Description
TRUEevaluated 8219675 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 40951505 times by 1 test
Evaluated by:
  • Self test
pathname)[0] == '\177'
(pathname)[0] == '\177'Description
TRUEevaluated 8219675 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 40951505 times by 1 test
Evaluated by:
  • Self test
&& (
(pathname)[1] == '\0'Description
TRUEevaluated 8219675 times by 1 test
Evaluated by:
  • Self test
FALSEnever evaluated
pathname)[1] == '\0'
(pathname)[1] == '\0'Description
TRUEevaluated 8219675 times by 1 test
Evaluated by:
  • Self test
FALSEnever evaluated
))
0-49171180
147 {-
148 temp[0] = '\0';-
149 return
executed 8219675 times by 1 test: return temp;
Executed by:
  • Self test
temp;
executed 8219675 times by 1 test: return temp;
Executed by:
  • Self test
8219675
150 }-
151-
152 cclass = collsym = equiv = last_was_backslash = 0;-
153 for (i = j = 0; pathname[i]
pathname[i]Description
TRUEevaluated 115655548 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 40952302 times by 1 test
Evaluated by:
  • Self test
; i++)
40952302-115655548
154 {-
155-
156 if (pathname[i] == '\001'
pathname[i] == '\001'Description
TRUEevaluated 87526480 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 28129068 times by 1 test
Evaluated by:
  • Self test
&& pathname[i+1] == '\0'
pathname[i+1] == '\0'Description
TRUEnever evaluated
FALSEevaluated 87526480 times by 1 test
Evaluated by:
  • Self test
)
0-87526480
157 {-
158 temp[j++] = pathname[i++];-
159 break;
never executed: break;
0
160 }-
161-
162-
163 else if ((
(qflags & (0x04|0x08))Description
TRUEevaluated 28117882 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 87537666 times by 1 test
Evaluated by:
  • Self test
qflags & (0x04|0x08))
(qflags & (0x04|0x08))Description
TRUEevaluated 28117882 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 87537666 times by 1 test
Evaluated by:
  • Self test
&& pathname[i] == '\001'
pathname[i] == '\001'Description
TRUEevaluated 259 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 28117623 times by 1 test
Evaluated by:
  • Self test
&& pathname[i+1] == '\001'
pathname[i+1] == '\001'Description
TRUEevaluated 24 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 235 times by 1 test
Evaluated by:
  • Self test
)
24-87537666
164 {-
165 i++;-
166 temp[j++] = pathname[i];-
167 continue;
executed 24 times by 1 test: continue;
Executed by:
  • Self test
24
168 }-
169 else if (pathname[i] == '\001'
pathname[i] == '\001'Description
TRUEevaluated 87526456 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 28129068 times by 1 test
Evaluated by:
  • Self test
)
28129068-87526456
170 {-
171 if ((
(qflags & 0x02)Description
TRUEevaluated 32 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 87526424 times by 1 test
Evaluated by:
  • Self test
qflags & 0x02)
(qflags & 0x02)Description
TRUEevaluated 32 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 87526424 times by 1 test
Evaluated by:
  • Self test
&& pathname[i+1] == '/'
pathname[i+1] == '/'Description
TRUEnever evaluated
FALSEevaluated 32 times by 1 test
Evaluated by:
  • Self test
)
0-87526424
172 continue;
never executed: continue;
0
173-
174 if (pathname[i+1] != '\001'
pathname[i+1] != '\001'Description
TRUEevaluated 87526392 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 64 times by 1 test
Evaluated by:
  • Self test
&& (
(qflags & 0x04)Description
TRUEevaluated 194 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 87526198 times by 1 test
Evaluated by:
  • Self test
qflags & 0x04)
(qflags & 0x04)Description
TRUEevaluated 194 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 87526198 times by 1 test
Evaluated by:
  • Self test
&& ere_char (pathname[i+1]) == 0
ere_char (pathname[i+1]) == 0Description
TRUEevaluated 125 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 69 times by 1 test
Evaluated by:
  • Self test
)
64-87526392
175 continue;
executed 125 times by 1 test: continue;
Executed by:
  • Self test
125
176 temp[j++] = '\\';-
177 i++;-
178 if (pathname[i] == '\0'
pathname[i] == '\0'Description
TRUEnever evaluated
FALSEevaluated 87526331 times by 1 test
Evaluated by:
  • Self test
)
0-87526331
179 break;
never executed: break;
0
180 }
executed 87526331 times by 1 test: end of block
Executed by:
  • Self test
87526331
181 else if ((
(qflags & 0x04)Description
TRUEevaluated 339 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 28128729 times by 1 test
Evaluated by:
  • Self test
qflags & 0x04)
(qflags & 0x04)Description
TRUEevaluated 339 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 28128729 times by 1 test
Evaluated by:
  • Self test
&& (i == 0
i == 0Description
TRUEevaluated 41 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 298 times by 1 test
Evaluated by:
  • Self test
|| pathname[i-1] != '\001'
pathname[i-1] != '\001'Description
TRUEevaluated 170 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 128 times by 1 test
Evaluated by:
  • Self test
) && pathname[i] == '['
pathname[i] == '['Description
TRUEevaluated 39 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 172 times by 1 test
Evaluated by:
  • Self test
)
39-28128729
182 {-
183 temp[j++] = pathname[i++];-
184 savej = j;-
185 savei = i;-
186 c = pathname[i++];-
187 if (c == '^'
c == '^'Description
TRUEevaluated 7 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 32 times by 1 test
Evaluated by:
  • Self test
)
7-32
188 {-
189 temp[j++] = c;-
190 c = pathname[i++];-
191 }
executed 7 times by 1 test: end of block
Executed by:
  • Self test
7
192 if (c == ']'
c == ']'Description
TRUEevaluated 1 time by 1 test
Evaluated by:
  • Self test
FALSEevaluated 38 times by 1 test
Evaluated by:
  • Self test
)
1-38
193 {-
194 temp[j++] = c;-
195 c = pathname[i++];-
196 }
executed 1 time by 1 test: end of block
Executed by:
  • Self test
1
197 do-
198 {-
199 if (c == 0
c == 0Description
TRUEnever evaluated
FALSEevaluated 146 times by 1 test
Evaluated by:
  • Self test
)
0-146
200 goto
never executed: goto endpat;
endpat;
never executed: goto endpat;
0
201 else if (c == '\001'
c == '\001'Description
TRUEevaluated 16 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 130 times by 1 test
Evaluated by:
  • Self test
)
16-130
202 {-
203-
204-
205 if (pathname[i] == 0
pathname[i] == 0Description
TRUEnever evaluated
FALSEevaluated 16 times by 1 test
Evaluated by:
  • Self test
)
0-16
206 goto
never executed: goto endpat;
endpat;
never executed: goto endpat;
0
207 temp[j++] = pathname[i++];-
208 }
executed 16 times by 1 test: end of block
Executed by:
  • Self test
16
209 else if (c == '['
c == '['Description
TRUEevaluated 23 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 107 times by 1 test
Evaluated by:
  • Self test
&& pathname[i] == ':'
pathname[i] == ':'Description
TRUEevaluated 9 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 14 times by 1 test
Evaluated by:
  • Self test
)
9-107
210 {-
211 temp[j++] = c;-
212 temp[j++] = pathname[i++];-
213 cclass = 1;-
214 }
executed 9 times by 1 test: end of block
Executed by:
  • Self test
9
215 else if (cclass
cclassDescription
TRUEevaluated 54 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 67 times by 1 test
Evaluated by:
  • Self test
&& c == ':'
c == ':'Description
TRUEevaluated 9 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 45 times by 1 test
Evaluated by:
  • Self test
&& pathname[i] == ']'
pathname[i] == ']'Description
TRUEevaluated 9 times by 1 test
Evaluated by:
  • Self test
FALSEnever evaluated
)
0-67
216 {-
217 temp[j++] = c;-
218 temp[j++] = pathname[i++];-
219 cclass = 0;-
220 }
executed 9 times by 1 test: end of block
Executed by:
  • Self test
9
221 else if (c == '['
c == '['Description
TRUEevaluated 14 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 98 times by 1 test
Evaluated by:
  • Self test
&& pathname[i] == '='
pathname[i] == '='Description
TRUEevaluated 6 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 8 times by 1 test
Evaluated by:
  • Self test
)
6-98
222 {-
223 temp[j++] = c;-
224 temp[j++] = pathname[i++];-
225 if (pathname[i] == ']'
pathname[i] == ']'Description
TRUEnever evaluated
FALSEevaluated 6 times by 1 test
Evaluated by:
  • Self test
)
0-6
226 temp[j++] = pathname[i++];
never executed: temp[j++] = pathname[i++];
0
227 equiv = 1;-
228 }
executed 6 times by 1 test: end of block
Executed by:
  • Self test
6
229 else if (equiv
equivDescription
TRUEevaluated 12 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 94 times by 1 test
Evaluated by:
  • Self test
&& c == '='
c == '='Description
TRUEevaluated 6 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 6 times by 1 test
Evaluated by:
  • Self test
&& pathname[i] == ']'
pathname[i] == ']'Description
TRUEevaluated 6 times by 1 test
Evaluated by:
  • Self test
FALSEnever evaluated
)
0-94
230 {-
231 temp[j++] = c;-
232 temp[j++] = pathname[i++];-
233 equiv = 0;-
234 }
executed 6 times by 1 test: end of block
Executed by:
  • Self test
6
235 else if (c == '['
c == '['Description
TRUEevaluated 8 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 92 times by 1 test
Evaluated by:
  • Self test
&& pathname[i] == '.'
pathname[i] == '.'Description
TRUEevaluated 8 times by 1 test
Evaluated by:
  • Self test
FALSEnever evaluated
)
0-92
236 {-
237 temp[j++] = c;-
238 temp[j++] = pathname[i++];-
239 if (pathname[i] == ']'
pathname[i] == ']'Description
TRUEnever evaluated
FALSEevaluated 8 times by 1 test
Evaluated by:
  • Self test
)
0-8
240 temp[j++] = pathname[i++];
never executed: temp[j++] = pathname[i++];
0
241 collsym = 1;-
242 }
executed 8 times by 1 test: end of block
Executed by:
  • Self test
8
243 else if (collsym
collsymDescription
TRUEevaluated 16 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 76 times by 1 test
Evaluated by:
  • Self test
&& c == '.'
c == '.'Description
TRUEevaluated 8 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 8 times by 1 test
Evaluated by:
  • Self test
&& pathname[i] == ']'
pathname[i] == ']'Description
TRUEevaluated 8 times by 1 test
Evaluated by:
  • Self test
FALSEnever evaluated
)
0-76
244 {-
245 temp[j++] = c;-
246 temp[j++] = pathname[i++];-
247 collsym = 0;-
248 }
executed 8 times by 1 test: end of block
Executed by:
  • Self test
8
249 else-
250 temp[j++] = c;
executed 84 times by 1 test: temp[j++] = c;
Executed by:
  • Self test
84
251 }-
252 while (((
((c = pathname[i++]) != ']')Description
TRUEevaluated 108 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 38 times by 1 test
Evaluated by:
  • Self test
c = pathname[i++]) != ']')
((c = pathname[i++]) != ']')Description
TRUEevaluated 108 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 38 times by 1 test
Evaluated by:
  • Self test
&& c != 0
c != 0Description
TRUEevaluated 107 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 1 time by 1 test
Evaluated by:
  • Self test
);
1-108
253-
254-
255-
256-
257-
258 if (c == 0
c == 0Description
TRUEevaluated 1 time by 1 test
Evaluated by:
  • Self test
FALSEevaluated 38 times by 1 test
Evaluated by:
  • Self test
)
1-38
259 {-
260 i = savei - 1;-
261 j = savej;-
262 continue;
executed 1 time by 1 test: continue;
Executed by:
  • Self test
1
263 }-
264-
265 temp[j++] = c;-
266 i--;-
267 continue;
executed 38 times by 1 test: continue;
Executed by:
  • Self test
38
268 }-
269 else if (pathname[i] == '\\'
pathname[i] == '\\'Description
TRUEevaluated 110 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 28128919 times by 1 test
Evaluated by:
  • Self test
&& (
(qflags & 0x04) == 0Description
TRUEevaluated 101 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 9 times by 1 test
Evaluated by:
  • Self test
qflags & 0x04) == 0
(qflags & 0x04) == 0Description
TRUEevaluated 101 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 9 times by 1 test
Evaluated by:
  • Self test
)
9-28128919
270 {-
271-
272-
273-
274-
275-
276-
277 temp[j++] = '\\';-
278-
279 i++;-
280 if (pathname[i] == '\0'
pathname[i] == '\0'Description
TRUEevaluated 8 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 93 times by 1 test
Evaluated by:
  • Self test
)
8-93
281 break;
executed 8 times by 1 test: break;
Executed by:
  • Self test
8
282-
283-
284 if ((
(qflags & 0x08)Description
TRUEevaluated 55 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 38 times by 1 test
Evaluated by:
  • Self test
qflags & 0x08)
(qflags & 0x08)Description
TRUEevaluated 55 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 38 times by 1 test
Evaluated by:
  • Self test
&& pathname[i] == '\001'
pathname[i] == '\001'Description
TRUEevaluated 4 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 51 times by 1 test
Evaluated by:
  • Self test
&& pathname[i+1] == '\001'
pathname[i+1] == '\001'Description
TRUEevaluated 4 times by 1 test
Evaluated by:
  • Self test
FALSEnever evaluated
)
0-55
285 i++;
executed 4 times by 1 test: i++;
Executed by:
  • Self test
4
286 }
executed 93 times by 1 test: end of block
Executed by:
  • Self test
93
287 else if (pathname[i] == '\\'
pathname[i] == '\\'Description
TRUEevaluated 9 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 28128919 times by 1 test
Evaluated by:
  • Self test
&& (
(qflags & 0x04)Description
TRUEevaluated 9 times by 1 test
Evaluated by:
  • Self test
FALSEnever evaluated
qflags & 0x04)
(qflags & 0x04)Description
TRUEevaluated 9 times by 1 test
Evaluated by:
  • Self test
FALSEnever evaluated
)
0-28128919
288 last_was_backslash = 1;
executed 9 times by 1 test: last_was_backslash = 1;
Executed by:
  • Self test
9
289 temp[j++] = pathname[i];-
290 }
executed 115655352 times by 1 test: end of block
Executed by:
  • Self test
115655352
291endpat:
code before this statement executed 40952310 times by 1 test: endpat:
Executed by:
  • Self test
40952310
292 temp[j] = '\0';-
293-
294 return
executed 40952310 times by 1 test: return (temp);
Executed by:
  • Self test
(temp);
executed 40952310 times by 1 test: return (temp);
Executed by:
  • Self test
40952310
295}-
296-
297char *-
298quote_globbing_chars (string)-
299 const char *string;-
300{-
301 size_t slen;-
302 char *temp, *t;-
303 const char *s, *send;-
304 mbstate_t state; memset (&state, '\0', sizeof (mbstate_t));-
305-
306 slen = strlen (string);-
307 send = string + slen;-
308-
309 temp = (char *)sh_xmalloc((slen * 2 + 1), "pathexp.c", 354);-
310 for (t = temp, s = string; *
*sDescription
TRUEevaluated 109 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 5 times by 1 test
Evaluated by:
  • Self test
s
*sDescription
TRUEevaluated 109 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 5 times by 1 test
Evaluated by:
  • Self test
; )
5-109
311 {-
312 if (glob_char_p (s)
glob_char_p (s)Description
TRUEevaluated 9 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 100 times by 1 test
Evaluated by:
  • Self test
)
9-100
313 *
executed 9 times by 1 test: *t++ = '\\';
Executed by:
  • Self test
t++ = '\\';
executed 9 times by 1 test: *t++ = '\\';
Executed by:
  • Self test
9
314-
315-
316-
317 do { if (locale_mb_cur_max > 1
locale_mb_cur_max > 1Description
TRUEevaluated 43 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 66 times by 1 test
Evaluated by:
  • Self test
) { mbstate_t state_bak; size_t mblength; int _k; _k = is_basic (*(s)); if (_k
_kDescription
TRUEevaluated 42 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 1 time by 1 test
Evaluated by:
  • Self test
) mblength = 1;
executed 42 times by 1 test: mblength = 1;
Executed by:
  • Self test
else if (locale_utf8locale
locale_utf8localeDescription
TRUEevaluated 1 time by 1 test
Evaluated by:
  • Self test
FALSEnever evaluated
&& ((*(
((*(s) & 0x80) == 0)Description
TRUEevaluated 1 time by 1 test
Evaluated by:
  • Self test
FALSEnever evaluated
s) & 0x80) == 0)
((*(s) & 0x80) == 0)Description
TRUEevaluated 1 time by 1 test
Evaluated by:
  • Self test
FALSEnever evaluated
) mblength = 1;
executed 1 time by 1 test: mblength = 1;
Executed by:
  • Self test
else { state_bak = state; mblength = mbrlen ((s), (send) - (s), &state); }
never executed: end of block
if (mblength == (size_t)-2
mblength == (size_t)-2Description
TRUEnever evaluated
FALSEevaluated 43 times by 1 test
Evaluated by:
  • Self test
|| mblength == (size_t)-1
mblength == (size_t)-1Description
TRUEnever evaluated
FALSEevaluated 43 times by 1 test
Evaluated by:
  • Self test
) { state = state_bak; mblength = 1; }
never executed: end of block
else mblength = (
(mblength < 1)Description
TRUEnever evaluated
FALSEevaluated 43 times by 1 test
Evaluated by:
  • Self test
mblength < 1)
(mblength < 1)Description
TRUEnever evaluated
FALSEevaluated 43 times by 1 test
Evaluated by:
  • Self test
? 1 : mblength;
executed 43 times by 1 test: mblength = (mblength < 1) ? 1 : mblength;
Executed by:
  • Self test
for (_k = 0; _k < mblength
_k < mblengthDescription
TRUEevaluated 43 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 43 times by 1 test
Evaluated by:
  • Self test
; _k++) *(
executed 43 times by 1 test: *(t)++ = *(s)++;
Executed by:
  • Self test
t)++ = *(s)++;
executed 43 times by 1 test: *(t)++ = *(s)++;
Executed by:
  • Self test
}
executed 43 times by 1 test: end of block
Executed by:
  • Self test
else *(
executed 66 times by 1 test: *(t)++ = *(s)++;
Executed by:
  • Self test
t)++ = *(s)++;
executed 66 times by 1 test: *(t)++ = *(s)++;
Executed by:
  • Self test
} while (0);
0-66
318 }
executed 109 times by 1 test: end of block
Executed by:
  • Self test
109
319 *t = '\0';-
320 return
executed 5 times by 1 test: return temp;
Executed by:
  • Self test
temp;
executed 5 times by 1 test: return temp;
Executed by:
  • Self test
5
321}-
322-
323-
324char **-
325shell_glob_filename (pathname)-
326 const char *pathname;-
327{-
328 char *temp, **results;-
329 int gflags;-
330-
331 noglob_dot_filenames = glob_dot_filenames == 0;-
332-
333 temp = quote_string_for_globbing (pathname, 0x02);-
334 gflags = glob_star
glob_starDescription
TRUEevaluated 25 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 780 times by 1 test
Evaluated by:
  • Self test
? 0x400 : 0;
25-780
335 results = glob_filename (temp, gflags);-
336 sh_xfree((temp), "pathexp.c", 429);-
337-
338 if (results
resultsDescription
TRUEevaluated 805 times by 1 test
Evaluated by:
  • Self test
FALSEnever evaluated
&& (((
(((results) ==..._return) == 0)Description
TRUEevaluated 748 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 57 times by 1 test
Evaluated by:
  • Self test
results) == (char **)&glob_error_return) == 0)
(((results) ==..._return) == 0)Description
TRUEevaluated 748 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 57 times by 1 test
Evaluated by:
  • Self test
)
0-805
339 {-
340 if (should_ignore_glob_matches ()
should_ignore_glob_matches ()Description
TRUEevaluated 4 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 744 times by 1 test
Evaluated by:
  • Self test
)
4-744
341 ignore_glob_matches (results);
executed 4 times by 1 test: ignore_glob_matches (results);
Executed by:
  • Self test
4
342 if (results
resultsDescription
TRUEevaluated 748 times by 1 test
Evaluated by:
  • Self test
FALSEnever evaluated
&& results[0]
results[0]Description
TRUEevaluated 110 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 638 times by 1 test
Evaluated by:
  • Self test
)
0-748
343 strvec_sort (results);
executed 110 times by 1 test: strvec_sort (results);
Executed by:
  • Self test
110
344 else-
345 {-
346 do { if (results
resultsDescription
TRUEevaluated 638 times by 1 test
Evaluated by:
  • Self test
FALSEnever evaluated
) sh_xfree((results), "pathexp.c", 439);
executed 638 times by 1 test: sh_xfree((results), "pathexp.c", 439);
Executed by:
  • Self test
} while (0);
0-638
347 results = (char **)&glob_error_return;-
348 }
executed 638 times by 1 test: end of block
Executed by:
  • Self test
638
349 }-
350-
351 return
executed 805 times by 1 test: return (results);
Executed by:
  • Self test
(results);
executed 805 times by 1 test: return (results);
Executed by:
  • Self test
805
352-
353}-
354-
355-
356-
357static struct ignorevar globignore =-
358{-
359 "GLOBIGNORE",-
360 (struct ign *)0,-
361 0,-
362 (char *)0,-
363 (sh_iv_item_func_t *)0,-
364};-
365-
366-
367-
368-
369void-
370setup_glob_ignore (name)-
371 char *name;-
372{-
373 char *v;-
374-
375 v = get_string_value (name);-
376 setup_ignore_patterns (&globignore);-
377-
378 if (globignore.num_ignores
globignore.num_ignoresDescription
TRUEevaluated 4 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 18 times by 1 test
Evaluated by:
  • Self test
)
4-18
379 glob_dot_filenames = 1;
executed 4 times by 1 test: glob_dot_filenames = 1;
Executed by:
  • Self test
4
380 else if (v == 0
v == 0Description
TRUEevaluated 17 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 1 time by 1 test
Evaluated by:
  • Self test
)
1-17
381 glob_dot_filenames = 0;
executed 17 times by 1 test: glob_dot_filenames = 0;
Executed by:
  • Self test
17
382}
executed 22 times by 1 test: end of block
Executed by:
  • Self test
22
383-
384int-
385should_ignore_glob_matches ()-
386{-
387 return
executed 748 times by 1 test: return globignore.num_ignores;
Executed by:
  • Self test
globignore.num_ignores;
executed 748 times by 1 test: return globignore.num_ignores;
Executed by:
  • Self test
748
388}-
389-
390-
391static int-
392glob_name_is_acceptable (name)-
393 const char *name;-
394{-
395 struct ign *p;-
396 int flags;-
397-
398-
399 if (name[0] == '.'
name[0] == '.'Description
TRUEevaluated 6 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 62 times by 1 test
Evaluated by:
  • Self test
&& (name[1] == '\0'
name[1] == '\0'Description
TRUEnever evaluated
FALSEevaluated 6 times by 1 test
Evaluated by:
  • Self test
|| (name[1] == '.'
name[1] == '.'Description
TRUEnever evaluated
FALSEevaluated 6 times by 1 test
Evaluated by:
  • Self test
&& name[2] == '\0'
name[2] == '\0'Description
TRUEnever evaluated
FALSEnever evaluated
)))
0-62
400 return
never executed: return (0);
(0);
never executed: return (0);
0
401-
402 flags = (1 << 0) | (extended_glob ? (1 << 5) : 0) | (glob_ignore_case ? (1 << 4) : 0);-
403 for (p = globignore.ignores; p->val
p->valDescription
TRUEevaluated 184 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 19 times by 1 test
Evaluated by:
  • Self test
; p++)
19-184
404 {-
405 if (strmatch (p->val, (char *)name, flags) != 1
strmatch (p->v...e, flags) != 1Description
TRUEevaluated 49 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 135 times by 1 test
Evaluated by:
  • Self test
)
49-135
406 return
executed 49 times by 1 test: return (0);
Executed by:
  • Self test
(0);
executed 49 times by 1 test: return (0);
Executed by:
  • Self test
49
407 }
executed 135 times by 1 test: end of block
Executed by:
  • Self test
135
408 return
executed 19 times by 1 test: return (1);
Executed by:
  • Self test
(1);
executed 19 times by 1 test: return (1);
Executed by:
  • Self test
19
409}-
410-
411-
412-
413-
414-
415-
416-
417static void-
418ignore_globbed_names (names, name_func)-
419 char **names;-
420 sh_ignore_func_t *name_func;-
421{-
422 char **newnames;-
423 int n, i;-
424-
425 for (i = 0; names[i]
names[i]Description
TRUEevaluated 68 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 4 times by 1 test
Evaluated by:
  • Self test
; i++)
4-68
426 ;
executed 68 times by 1 test: ;
Executed by:
  • Self test
68
427 newnames = strvec_create (i + 1);-
428-
429 for (n = i = 0; names[i]
names[i]Description
TRUEevaluated 68 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 4 times by 1 test
Evaluated by:
  • Self test
; i++)
4-68
430 {-
431 if ((*
(*name_func) (names[i])Description
TRUEevaluated 19 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 49 times by 1 test
Evaluated by:
  • Self test
name_func) (names[i])
(*name_func) (names[i])Description
TRUEevaluated 19 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 49 times by 1 test
Evaluated by:
  • Self test
)
19-49
432 newnames[n++] = names[i];
executed 19 times by 1 test: newnames[n++] = names[i];
Executed by:
  • Self test
19
433 else-
434 sh_xfree((names[i]), "pathexp.c", 527);
executed 49 times by 1 test: sh_xfree((names[i]), "pathexp.c", 527);
Executed by:
  • Self test
49
435 }-
436-
437 newnames[n] = (char *)-
438 ((void *)0)-
439 ;-
440-
441 if (n == 0
n == 0Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 2 times by 1 test
Evaluated by:
  • Self test
)
2
442 {-
443 names[0] = (char *)-
444 ((void *)0)-
445 ;-
446 sh_xfree((newnames), "pathexp.c", 535);-
447 return;
executed 2 times by 1 test: return;
Executed by:
  • Self test
2
448 }-
449-
450-
451-
452 for (n = 0; newnames[n]
newnames[n]Description
TRUEevaluated 19 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 2 times by 1 test
Evaluated by:
  • Self test
; n++)
2-19
453 names[n] = newnames[n];
executed 19 times by 1 test: names[n] = newnames[n];
Executed by:
  • Self test
19
454 names[n] = (char *)-
455 ((void *)0)-
456 ;-
457 sh_xfree((newnames), "pathexp.c", 544);-
458}
executed 2 times by 1 test: end of block
Executed by:
  • Self test
2
459-
460void-
461ignore_glob_matches (names)-
462 char **names;-
463{-
464 if (globignore.num_ignores == 0
globignore.num_ignores == 0Description
TRUEnever evaluated
FALSEevaluated 4 times by 1 test
Evaluated by:
  • Self test
)
0-4
465 return;
never executed: return;
0
466-
467 ignore_globbed_names (names, glob_name_is_acceptable);-
468}
executed 4 times by 1 test: end of block
Executed by:
  • Self test
4
469-
470static char *-
471split_ignorespec (s, ip)-
472 char *s;-
473 int *ip;-
474{-
475 char *t;-
476 int n, i;-
477-
478 if (s == 0
s == 0Description
TRUEnever evaluated
FALSEevaluated 26 times by 1 test
Evaluated by:
  • Self test
)
0-26
479 return
never executed: return 0;
0;
never executed: return 0;
0
480-
481 i = *ip;-
482 if (s[i] == 0
s[i] == 0Description
TRUEevaluated 6 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 20 times by 1 test
Evaluated by:
  • Self test
)
6-20
483 return
executed 6 times by 1 test: return 0;
Executed by:
  • Self test
0;
executed 6 times by 1 test: return 0;
Executed by:
  • Self test
6
484-
485 n = skip_to_delim (s, i, ":", 0x001|0x010|0x040);-
486 t = substring (s, i, n);-
487-
488 if (s[n] == ':'
s[n] == ':'Description
TRUEevaluated 14 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 6 times by 1 test
Evaluated by:
  • Self test
)
6-14
489 n++;
executed 14 times by 1 test: n++;
Executed by:
  • Self test
14
490 *ip = n;-
491 return
executed 20 times by 1 test: return t;
Executed by:
  • Self test
t;
executed 20 times by 1 test: return t;
Executed by:
  • Self test
20
492}-
493-
494void-
495setup_ignore_patterns (ivp)-
496 struct ignorevar *ivp;-
497{-
498 int numitems, maxitems, ptr;-
499 char *colon_bit, *this_ignoreval;-
500 struct ign *p;-
501-
502 this_ignoreval = get_string_value (ivp->varname);-
503-
504-
505 if ((this_ignoreval
this_ignorevalDescription
TRUEevaluated 10 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 50 times by 1 test
Evaluated by:
  • Self test
&& ivp->last_ignoreval
ivp->last_ignorevalDescription
TRUEevaluated 5 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 5 times by 1 test
Evaluated by:
  • Self test
&& ((
(this_ignoreva..._ignoreval)[0]Description
TRUEevaluated 5 times by 1 test
Evaluated by:
  • Self test
FALSEnever evaluated
this_ignoreval)[0] == (ivp->last_ignoreval)[0]
(this_ignoreva..._ignoreval)[0]Description
TRUEevaluated 5 times by 1 test
Evaluated by:
  • Self test
FALSEnever evaluated
&&
0-50
506 __extension__ ({ size_t __s1_len, __s2_len; (__builtin_constant_p (
__extension__ ... )))); }) == 0Description
TRUEevaluated 3 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 2 times by 1 test
Evaluated by:
  • Self test
2-3
507 this_ignoreval
__extension__ ... )))); }) == 0Description
TRUEevaluated 3 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 2 times by 1 test
Evaluated by:
  • Self test
2-3
508 ) && __builtin_constant_p (
__extension__ ... )))); }) == 0Description
TRUEevaluated 3 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 2 times by 1 test
Evaluated by:
  • Self test
2-3
509 ivp->last_ignoreval
__extension__ ... )))); }) == 0Description
TRUEevaluated 3 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 2 times by 1 test
Evaluated by:
  • Self test
2-3
510 ) && (__s1_len = __builtin_strlen (
__extension__ ... )))); }) == 0Description
TRUEevaluated 3 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 2 times by 1 test
Evaluated by:
  • Self test
2-3
511 this_ignoreval
__extension__ ... )))); }) == 0Description
TRUEevaluated 3 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 2 times by 1 test
Evaluated by:
  • Self test
2-3
512 ), __s2_len = __builtin_strlen (
__extension__ ... )))); }) == 0Description
TRUEevaluated 3 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 2 times by 1 test
Evaluated by:
  • Self test
2-3
513 ivp->last_ignoreval
__extension__ ... )))); }) == 0Description
TRUEevaluated 3 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 2 times by 1 test
Evaluated by:
  • Self test
2-3
514 ), (!((size_t)(const void *)((
__extension__ ... )))); }) == 0Description
TRUEevaluated 3 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 2 times by 1 test
Evaluated by:
  • Self test
2-3
515 this_ignoreval
__extension__ ... )))); }) == 0Description
TRUEevaluated 3 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 2 times by 1 test
Evaluated by:
  • Self test
2-3
516 ) + 1) - (size_t)(const void *)(
__extension__ ... )))); }) == 0Description
TRUEevaluated 3 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 2 times by 1 test
Evaluated by:
  • Self test
2-3
517 this_ignoreval
__extension__ ... )))); }) == 0Description
TRUEevaluated 3 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 2 times by 1 test
Evaluated by:
  • Self test
2-3
518 ) == 1) || __s1_len >= 4) && (!((size_t)(const void *)((
__extension__ ... )))); }) == 0Description
TRUEevaluated 3 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 2 times by 1 test
Evaluated by:
  • Self test
2-3
519 ivp->last_ignoreval
__extension__ ... )))); }) == 0Description
TRUEevaluated 3 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 2 times by 1 test
Evaluated by:
  • Self test
2-3
520 ) + 1) - (size_t)(const void *)(
__extension__ ... )))); }) == 0Description
TRUEevaluated 3 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 2 times by 1 test
Evaluated by:
  • Self test
2-3
521 ivp->last_ignoreval
__extension__ ... )))); }) == 0Description
TRUEevaluated 3 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 2 times by 1 test
Evaluated by:
  • Self test
2-3
522 ) == 1) || __s2_len >= 4)) ? __builtin_strcmp (
__extension__ ... )))); }) == 0Description
TRUEevaluated 3 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 2 times by 1 test
Evaluated by:
  • Self test
2-3
523 this_ignoreval
__extension__ ... )))); }) == 0Description
TRUEevaluated 3 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 2 times by 1 test
Evaluated by:
  • Self test
2-3
524 ,
__extension__ ... )))); }) == 0Description
TRUEevaluated 3 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 2 times by 1 test
Evaluated by:
  • Self test
2-3
525 ivp->last_ignoreval
__extension__ ... )))); }) == 0Description
TRUEevaluated 3 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 2 times by 1 test
Evaluated by:
  • Self test
2-3
526 ) : (__builtin_constant_p (
__extension__ ... )))); }) == 0Description
TRUEevaluated 3 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 2 times by 1 test
Evaluated by:
  • Self test
2-3
527 this_ignoreval
__extension__ ... )))); }) == 0Description
TRUEevaluated 3 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 2 times by 1 test
Evaluated by:
  • Self test
2-3
528 ) && ((size_t)(const void *)((
__extension__ ... )))); }) == 0Description
TRUEevaluated 3 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 2 times by 1 test
Evaluated by:
  • Self test
2-3
529 this_ignoreval
__extension__ ... )))); }) == 0Description
TRUEevaluated 3 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 2 times by 1 test
Evaluated by:
  • Self test
2-3
530 ) + 1) - (size_t)(const void *)(
__extension__ ... )))); }) == 0Description
TRUEevaluated 3 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 2 times by 1 test
Evaluated by:
  • Self test
2-3
531 this_ignoreval
__extension__ ... )))); }) == 0Description
TRUEevaluated 3 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 2 times by 1 test
Evaluated by:
  • Self test
2-3
532 ) == 1) && (__s1_len = __builtin_strlen (
__extension__ ... )))); }) == 0Description
TRUEevaluated 3 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 2 times by 1 test
Evaluated by:
  • Self test
2-3
533 this_ignoreval
__extension__ ... )))); }) == 0Description
TRUEevaluated 3 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 2 times by 1 test
Evaluated by:
  • Self test
2-3
534 ), __s1_len < 4) ? (__builtin_constant_p (
__extension__ ... )))); }) == 0Description
TRUEevaluated 3 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 2 times by 1 test
Evaluated by:
  • Self test
2-3
535 ivp->last_ignoreval
__extension__ ... )))); }) == 0Description
TRUEevaluated 3 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 2 times by 1 test
Evaluated by:
  • Self test
2-3
536 ) && ((size_t)(const void *)((
__extension__ ... )))); }) == 0Description
TRUEevaluated 3 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 2 times by 1 test
Evaluated by:
  • Self test
2-3
537 ivp->last_ignoreval
__extension__ ... )))); }) == 0Description
TRUEevaluated 3 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 2 times by 1 test
Evaluated by:
  • Self test
2-3
538 ) + 1) - (size_t)(const void *)(
__extension__ ... )))); }) == 0Description
TRUEevaluated 3 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 2 times by 1 test
Evaluated by:
  • Self test
2-3
539 ivp->last_ignoreval
__extension__ ... )))); }) == 0Description
TRUEevaluated 3 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 2 times by 1 test
Evaluated by:
  • Self test
2-3
540 ) == 1) ? __builtin_strcmp (
__extension__ ... )))); }) == 0Description
TRUEevaluated 3 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 2 times by 1 test
Evaluated by:
  • Self test
2-3
541 this_ignoreval
__extension__ ... )))); }) == 0Description
TRUEevaluated 3 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 2 times by 1 test
Evaluated by:
  • Self test
2-3
542 ,
__extension__ ... )))); }) == 0Description
TRUEevaluated 3 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 2 times by 1 test
Evaluated by:
  • Self test
2-3
543 ivp->last_ignoreval
__extension__ ... )))); }) == 0Description
TRUEevaluated 3 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 2 times by 1 test
Evaluated by:
  • Self test
2-3
544 ) : (__extension__ ({ const unsigned char *__s2 = (const unsigned char *) (const char *) (
__extension__ ... )))); }) == 0Description
TRUEevaluated 3 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 2 times by 1 test
Evaluated by:
  • Self test
2-3
545 ivp->last_ignoreval
__extension__ ... )))); }) == 0Description
TRUEevaluated 3 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 2 times by 1 test
Evaluated by:
  • Self test
2-3
546 ); int __result = (((const unsigned char *) (const char *) (
__extension__ ... )))); }) == 0Description
TRUEevaluated 3 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 2 times by 1 test
Evaluated by:
  • Self test
2-3
547 this_ignoreval
__extension__ ... )))); }) == 0Description
TRUEevaluated 3 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 2 times by 1 test
Evaluated by:
  • Self test
2-3
548 ))[0] - __s2[0]); if (__s1_len > 0
__s1_len > 0Description
TRUEnever evaluated
FALSEnever evaluated
&& __result == 0
__result == 0Description
TRUEnever evaluated
FALSEnever evaluated
) { __result = (((const unsigned char *) (const char *) (
__extension__ ... )))); }) == 0Description
TRUEevaluated 3 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 2 times by 1 test
Evaluated by:
  • Self test
0-3
549 this_ignoreval
__extension__ ... )))); }) == 0Description
TRUEevaluated 3 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 2 times by 1 test
Evaluated by:
  • Self test
2-3
550 ))[1] - __s2[1]); if (__s1_len > 1
__s1_len > 1Description
TRUEnever evaluated
FALSEnever evaluated
&& __result == 0
__result == 0Description
TRUEnever evaluated
FALSEnever evaluated
) { __result = (((const unsigned char *) (const char *) (
__extension__ ... )))); }) == 0Description
TRUEevaluated 3 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 2 times by 1 test
Evaluated by:
  • Self test
0-3
551 this_ignoreval
__extension__ ... )))); }) == 0Description
TRUEevaluated 3 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 2 times by 1 test
Evaluated by:
  • Self test
2-3
552 ))[2] - __s2[2]); if (__s1_len > 2
__s1_len > 2Description
TRUEnever evaluated
FALSEnever evaluated
&& __result == 0
__result == 0Description
TRUEnever evaluated
FALSEnever evaluated
) __result = (((const unsigned char *) (const char *) (
never executed: __result = (((const unsigned char *) (const char *) ( this_ignoreval ))[3] - __s2[3]);
__extension__ ... )))); }) == 0Description
TRUEevaluated 3 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 2 times by 1 test
Evaluated by:
  • Self test
0-3
553 this_ignoreval
__extension__ ... )))); }) == 0Description
TRUEevaluated 3 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 2 times by 1 test
Evaluated by:
  • Self test
never executed: __result = (((const unsigned char *) (const char *) ( this_ignoreval ))[3] - __s2[3]);
0-3
554 ))[3] - __s2[3]);
__extension__ ... )))); }) == 0Description
TRUEevaluated 3 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 2 times by 1 test
Evaluated by:
  • Self test
never executed: __result = (((const unsigned char *) (const char *) ( this_ignoreval ))[3] - __s2[3]);
}
never executed: end of block
}
never executed: end of block
__result; }))) : (__builtin_constant_p (
__extension__ ... )))); }) == 0Description
TRUEevaluated 3 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 2 times by 1 test
Evaluated by:
  • Self test
0-3
555 ivp->last_ignoreval
__extension__ ... )))); }) == 0Description
TRUEevaluated 3 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 2 times by 1 test
Evaluated by:
  • Self test
2-3
556 ) && ((size_t)(const void *)((
__extension__ ... )))); }) == 0Description
TRUEevaluated 3 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 2 times by 1 test
Evaluated by:
  • Self test
2-3
557 ivp->last_ignoreval
__extension__ ... )))); }) == 0Description
TRUEevaluated 3 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 2 times by 1 test
Evaluated by:
  • Self test
2-3
558 ) + 1) - (size_t)(const void *)(
__extension__ ... )))); }) == 0Description
TRUEevaluated 3 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 2 times by 1 test
Evaluated by:
  • Self test
2-3
559 ivp->last_ignoreval
__extension__ ... )))); }) == 0Description
TRUEevaluated 3 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 2 times by 1 test
Evaluated by:
  • Self test
2-3
560 ) == 1) && (__s2_len = __builtin_strlen (
__extension__ ... )))); }) == 0Description
TRUEevaluated 3 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 2 times by 1 test
Evaluated by:
  • Self test
2-3
561 ivp->last_ignoreval
__extension__ ... )))); }) == 0Description
TRUEevaluated 3 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 2 times by 1 test
Evaluated by:
  • Self test
2-3
562 ), __s2_len < 4) ? (__builtin_constant_p (
__extension__ ... )))); }) == 0Description
TRUEevaluated 3 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 2 times by 1 test
Evaluated by:
  • Self test
2-3
563 this_ignoreval
__extension__ ... )))); }) == 0Description
TRUEevaluated 3 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 2 times by 1 test
Evaluated by:
  • Self test
2-3
564 ) && ((size_t)(const void *)((
__extension__ ... )))); }) == 0Description
TRUEevaluated 3 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 2 times by 1 test
Evaluated by:
  • Self test
2-3
565 this_ignoreval
__extension__ ... )))); }) == 0Description
TRUEevaluated 3 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 2 times by 1 test
Evaluated by:
  • Self test
2-3
566 ) + 1) - (size_t)(const void *)(
__extension__ ... )))); }) == 0Description
TRUEevaluated 3 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 2 times by 1 test
Evaluated by:
  • Self test
2-3
567 this_ignoreval
__extension__ ... )))); }) == 0Description
TRUEevaluated 3 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 2 times by 1 test
Evaluated by:
  • Self test
2-3
568 ) == 1) ? __builtin_strcmp (
__extension__ ... )))); }) == 0Description
TRUEevaluated 3 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 2 times by 1 test
Evaluated by:
  • Self test
2-3
569 this_ignoreval
__extension__ ... )))); }) == 0Description
TRUEevaluated 3 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 2 times by 1 test
Evaluated by:
  • Self test
2-3
570 ,
__extension__ ... )))); }) == 0Description
TRUEevaluated 3 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 2 times by 1 test
Evaluated by:
  • Self test
2-3
571 ivp->last_ignoreval
__extension__ ... )))); }) == 0Description
TRUEevaluated 3 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 2 times by 1 test
Evaluated by:
  • Self test
2-3
572 ) : -(__extension__ ({ const unsigned char *__s2 = (const unsigned char *) (const char *) (
__extension__ ... )))); }) == 0Description
TRUEevaluated 3 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 2 times by 1 test
Evaluated by:
  • Self test
2-3
573 this_ignoreval
__extension__ ... )))); }) == 0Description
TRUEevaluated 3 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 2 times by 1 test
Evaluated by:
  • Self test
2-3
574 ); int __result = (((const unsigned char *) (const char *) (
__extension__ ... )))); }) == 0Description
TRUEevaluated 3 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 2 times by 1 test
Evaluated by:
  • Self test
2-3
575 ivp->last_ignoreval
__extension__ ... )))); }) == 0Description
TRUEevaluated 3 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 2 times by 1 test
Evaluated by:
  • Self test
2-3
576 ))[0] - __s2[0]); if (__s2_len > 0
__s2_len > 0Description
TRUEnever evaluated
FALSEnever evaluated
&& __result == 0
__result == 0Description
TRUEnever evaluated
FALSEnever evaluated
) { __result = (((const unsigned char *) (const char *) (
__extension__ ... )))); }) == 0Description
TRUEevaluated 3 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 2 times by 1 test
Evaluated by:
  • Self test
0-3
577 ivp->last_ignoreval
__extension__ ... )))); }) == 0Description
TRUEevaluated 3 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 2 times by 1 test
Evaluated by:
  • Self test
2-3
578 ))[1] - __s2[1]); if (__s2_len > 1
__s2_len > 1Description
TRUEnever evaluated
FALSEnever evaluated
&& __result == 0
__result == 0Description
TRUEnever evaluated
FALSEnever evaluated
) { __result = (((const unsigned char *) (const char *) (
__extension__ ... )))); }) == 0Description
TRUEevaluated 3 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 2 times by 1 test
Evaluated by:
  • Self test
0-3
579 ivp->last_ignoreval
__extension__ ... )))); }) == 0Description
TRUEevaluated 3 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 2 times by 1 test
Evaluated by:
  • Self test
2-3
580 ))[2] - __s2[2]); if (__s2_len > 2
__s2_len > 2Description
TRUEnever evaluated
FALSEnever evaluated
&& __result == 0
__result == 0Description
TRUEnever evaluated
FALSEnever evaluated
) __result = (((const unsigned char *) (const char *) (
never executed: __result = (((const unsigned char *) (const char *) ( ivp->last_ignoreval ))[3] - __s2[3]);
__extension__ ... )))); }) == 0Description
TRUEevaluated 3 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 2 times by 1 test
Evaluated by:
  • Self test
0-3
581 ivp->last_ignoreval
__extension__ ... )))); }) == 0Description
TRUEevaluated 3 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 2 times by 1 test
Evaluated by:
  • Self test
never executed: __result = (((const unsigned char *) (const char *) ( ivp->last_ignoreval ))[3] - __s2[3]);
0-3
582 ))[3] - __s2[3]);
__extension__ ... )))); }) == 0Description
TRUEevaluated 3 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 2 times by 1 test
Evaluated by:
  • Self test
never executed: __result = (((const unsigned char *) (const char *) ( ivp->last_ignoreval ))[3] - __s2[3]);
}
never executed: end of block
}
never executed: end of block
__result; }))) : __builtin_strcmp (
__extension__ ... )))); }) == 0Description
TRUEevaluated 3 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 2 times by 1 test
Evaluated by:
  • Self test
0-3
583 this_ignoreval
__extension__ ... )))); }) == 0Description
TRUEevaluated 3 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 2 times by 1 test
Evaluated by:
  • Self test
2-3
584 ,
__extension__ ... )))); }) == 0Description
TRUEevaluated 3 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 2 times by 1 test
Evaluated by:
  • Self test
2-3
585 ivp->last_ignoreval
__extension__ ... )))); }) == 0Description
TRUEevaluated 3 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 2 times by 1 test
Evaluated by:
  • Self test
2-3
586 )))); })
__extension__ ... )))); }) == 0Description
TRUEevaluated 3 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 2 times by 1 test
Evaluated by:
  • Self test
2-3
587 == 0
__extension__ ... )))); }) == 0Description
TRUEevaluated 3 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 2 times by 1 test
Evaluated by:
  • Self test
)) ||
2-3
588 (!this_ignoreval
!this_ignorevalDescription
TRUEevaluated 50 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 7 times by 1 test
Evaluated by:
  • Self test
&& !ivp->last_ignoreval
!ivp->last_ignorevalDescription
TRUEevaluated 49 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 1 time by 1 test
Evaluated by:
  • Self test
))
1-50
589 return;
executed 52 times by 1 test: return;
Executed by:
  • Self test
52
590-
591-
592 ivp->num_ignores = 0;-
593-
594 if (ivp->ignores
ivp->ignoresDescription
TRUEevaluated 3 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 5 times by 1 test
Evaluated by:
  • Self test
)
3-5
595 {-
596 for (p = ivp->ignores; p->val
p->valDescription
TRUEevaluated 10 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 3 times by 1 test
Evaluated by:
  • Self test
; p++)
3-10
597 sh_xfree((p->val), "pathexp.c", 602);
executed 10 times by 1 test: sh_xfree((p->val), "pathexp.c", 602);
Executed by:
  • Self test
10
598 sh_xfree((ivp->ignores), "pathexp.c", 603);-
599 ivp->ignores = (struct ign *)-
600 ((void *)0)-
601 ;-
602 }
executed 3 times by 1 test: end of block
Executed by:
  • Self test
3
603-
604 if (ivp->last_ignoreval
ivp->last_ignorevalDescription
TRUEevaluated 3 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 5 times by 1 test
Evaluated by:
  • Self test
)
3-5
605 {-
606 sh_xfree((ivp->last_ignoreval), "pathexp.c", 609);-
607 ivp->last_ignoreval = (char *)-
608 ((void *)0)-
609 ;-
610 }
executed 3 times by 1 test: end of block
Executed by:
  • Self test
3
611-
612 if (this_ignoreval == 0
this_ignoreval == 0Description
TRUEevaluated 1 time by 1 test
Evaluated by:
  • Self test
FALSEevaluated 7 times by 1 test
Evaluated by:
  • Self test
|| *
*this_ignoreval == '\0'Description
TRUEevaluated 1 time by 1 test
Evaluated by:
  • Self test
FALSEevaluated 6 times by 1 test
Evaluated by:
  • Self test
this_ignoreval == '\0'
*this_ignoreval == '\0'Description
TRUEevaluated 1 time by 1 test
Evaluated by:
  • Self test
FALSEevaluated 6 times by 1 test
Evaluated by:
  • Self test
)
1-7
613 return;
executed 2 times by 1 test: return;
Executed by:
  • Self test
2
614-
615 ivp->last_ignoreval = (char *)strcpy (sh_xmalloc((1 + strlen (this_ignoreval)), "pathexp.c", 616), (this_ignoreval));-
616-
617 numitems = maxitems = ptr = 0;-
618-
619-
620-
621-
622 while (colon_bit = split_ignorespec (this_ignoreval, &ptr)
colon_bit = sp...noreval, &ptr)Description
TRUEevaluated 20 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 6 times by 1 test
Evaluated by:
  • Self test
)
6-20
623-
624 {-
625 if (numitems + 1 >= maxitems
numitems + 1 >= maxitemsDescription
TRUEevaluated 6 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 14 times by 1 test
Evaluated by:
  • Self test
)
6-14
626 {-
627 maxitems += 10;-
628 ivp->ignores = (struct ign *)sh_xrealloc((ivp->ignores), (maxitems * sizeof (struct ign)), "pathexp.c", 629);-
629 }
executed 6 times by 1 test: end of block
Executed by:
  • Self test
6
630 ivp->ignores[numitems].val = colon_bit;-
631 ivp->ignores[numitems].len = strlen (colon_bit);-
632 ivp->ignores[numitems].flags = 0;-
633 if (ivp->item_func
ivp->item_funcDescription
TRUEevaluated 7 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 13 times by 1 test
Evaluated by:
  • Self test
)
7-13
634 (*
executed 7 times by 1 test: (*ivp->item_func) (&ivp->ignores[numitems]);
Executed by:
  • Self test
ivp->item_func) (&ivp->ignores[numitems]);
executed 7 times by 1 test: (*ivp->item_func) (&ivp->ignores[numitems]);
Executed by:
  • Self test
7
635 numitems++;-
636 }
executed 20 times by 1 test: end of block
Executed by:
  • Self test
20
637 ivp->ignores[numitems].val = (char *)-
638 ((void *)0)-
639 ;-
640 ivp->num_ignores = numitems;-
641}
executed 6 times by 1 test: end of block
Executed by:
  • Self test
6
Switch to Source codePreprocessed file

Generated by Squish Coco 4.1.2