Absolute File Name: | /home/opencoverage/opencoverage/guest-scripts/bash/src/pathexp.c |
Switch to Source code | Preprocessed file |
Line | Source | Count | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
2 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
3 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
4 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
5 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
6 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
7 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
8 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
9 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
10 | static int glob_name_is_acceptable (const char *); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
11 | static void ignore_globbed_names (char **, sh_ignore_func_t *); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
12 | static char *split_ignorespec (char *, int *); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
13 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
14 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
15 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
16 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
17 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
18 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
19 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
20 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
21 | int glob_dot_filenames; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
22 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
23 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
24 | int extended_glob = 0; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
25 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
26 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
27 | int glob_star = 0; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
28 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
29 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
30 | int | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
31 | unquoted_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++
| 62402102-196256284 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
44 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
45 | switch (c) | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
46 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
47 | case executed 13 times by 1 test: '?':case '?': Executed by:
executed 13 times by 1 test: case '?': Executed by:
| 13 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
48 | case executed 152 times by 1 test: '*':case '*': Executed by:
executed 152 times by 1 test: case '*': Executed by:
| 152 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
49 | return executed 165 times by 1 test: (1);return (1); Executed by:
executed 165 times by 1 test: return (1); Executed by:
| 165 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
50 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
51 | case executed 4455 times by 1 test: '[':case '[': Executed by:
executed 4455 times by 1 test: case '[': Executed by:
| 4455 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
52 | open++; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
53 | continue; executed 4455 times by 1 test: continue; Executed by:
| 4455 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
54 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
55 | case executed 4428 times by 1 test: ']':case ']': Executed by:
executed 4428 times by 1 test: case ']': Executed by:
| 4428 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
56 | if (open
| 603-3825 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
57 | return executed 603 times by 1 test: (1);return (1); Executed by:
executed 603 times by 1 test: return (1); Executed by:
| 603 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
58 | continue; executed 3825 times by 1 test: continue; Executed by:
| 3825 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
59 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
60 | case executed 3381 times by 1 test: '+':case '+': Executed by:
executed 3381 times by 1 test: case '+': Executed by:
| 3381 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
61 | case executed 72 times by 1 test: '@':case '@': Executed by:
executed 72 times by 1 test: case '@': Executed by:
| 72 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
62 | case executed 1557 times by 1 test: '!':case '!': Executed by:
executed 1557 times by 1 test: case '!': Executed by:
| 1557 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
63 | if (*
| 37-4973 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
64 | return executed 37 times by 1 test: (1);return (1); Executed by:
executed 37 times by 1 test: return (1); Executed by:
| 37 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
65 | continue; executed 4973 times by 1 test: continue; Executed by:
| 4973 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
66 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
67 | case executed 49577663 times by 1 test: '\001':case '\001': Executed by:
executed 49577663 times by 1 test: case '\001': Executed by:
| 49577663 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
68 | case executed 180 times by 1 test: '\\':case '\\': Executed by:
executed 180 times by 1 test: case '\\': Executed by:
| 180 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
69 | if (*
| 82-49577761 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
70 | return executed 82 times by 1 test: (0);return (0); Executed by:
executed 82 times by 1 test: return (0); Executed by:
| 82 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
71 | } executed 49577761 times by 1 test: end of block Executed by:
| 49577761 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
72 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
73 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
74 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
75 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
76 | string--; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
77 | do { if (locale_mb_cur_max > 1
executed 190590052 times by 1 test: else { state_bak = state; mblength = mbrlen ((string), (send - string), &state); }mblength = 1; Executed by:
executed 4103536 times by 1 test: if (mblength == (size_t)-2end of block Executed by:
executed 426 times by 1 test: else (end of block Executed by:
executed 194693162 times by 1 test: string) += (mblength < 1) ? 0 : (mblength - 1);(string) += (mblength < 1) ? 0 : (mblength - 1); Executed by:
executed 194693162 times by 1 test: } } while (0);(string) += (mblength < 1) ? 0 : (mblength - 1); Executed by:
| 183-194693588 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
78 | string++; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
79 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
80 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
81 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
82 | } executed 196242144 times by 1 test: end of block Executed by:
| 196242144 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
83 | return executed 62402102 times by 1 test: (0);return (0); Executed by:
executed 62402102 times by 1 test: return (0); Executed by:
| 62402102 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
84 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
85 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
86 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
87 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
88 | static inline int | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
89 | ere_char (c) | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
90 | int c; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
91 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
92 | switch (c) | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
93 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
94 | case executed 10 times by 1 test: '.':case '.': Executed by:
executed 10 times by 1 test: case '.': Executed by:
| 10 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
95 | case executed 18 times by 1 test: '[':case '[': Executed by:
executed 18 times by 1 test: case '[': Executed by:
| 18 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
96 | case executed 23 times by 1 test: '\\':case '\\': Executed by:
executed 23 times by 1 test: case '\\': Executed by:
| 23 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
97 | case executed 7 times by 1 test: '(':case '(': Executed by:
executed 7 times by 1 test: case '(': Executed by:
| 7 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
98 | case executed 7 times by 1 test: ')':case ')': Executed by:
executed 7 times by 1 test: case ')': Executed by:
| 7 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
99 | case executed 3 times by 1 test: '*':case '*': Executed by:
executed 3 times by 1 test: case '*': Executed by:
| 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:
executed 1 time by 1 test: case '$': Executed by:
| 1 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
106 | return executed 69 times by 1 test: 1;return 1; Executed by:
executed 69 times by 1 test: return 1; Executed by:
| 69 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
107 | default executed 125 times by 1 test: :default: Executed by:
executed 125 times by 1 test: default: Executed by:
| 125 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
108 | return executed 125 times by 1 test: 0;return 0; Executed by:
executed 125 times by 1 test: return 0; Executed by:
| 125 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
109 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
110 | return dead code: (0);return (0); dead code: return (0); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
111 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
112 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
113 | int | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
114 | glob_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:
executed 1 time by 1 test: case '[': Executed by:
| 1 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
121 | case executed 1 time by 1 test: ']':case ']': Executed by:
executed 1 time by 1 test: case ']': Executed by:
| 1 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
122 | case never executed: '?':case '?': never executed: case '?': | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
123 | case executed 7 times by 1 test: '\\':case '\\': Executed by:
executed 7 times by 1 test: case '\\': Executed by:
| 7 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
124 | return executed 9 times by 1 test: 1;return 1; Executed by:
executed 9 times by 1 test: return 1; Executed by:
| 9 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
125 | case executed 2 times by 1 test: '+':case '+': Executed by:
executed 2 times by 1 test: case '+': Executed by:
| 2 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
126 | case never executed: '@':case '@': never executed: case '@': | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
127 | case executed 9 times by 1 test: '!':case '!': Executed by:
executed 9 times by 1 test: case '!': Executed by:
| 9 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
128 | if (s[1] == '('
| 0-11 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
129 | return never executed: 1;return 1; never executed: return 1; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
130 | break; executed 11 times by 1 test: break; Executed by:
| 11 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
131 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
132 | return executed 102 times by 1 test: 0;return 0; Executed by:
executed 102 times by 1 test: return 0; Executed by:
| 102 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
133 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
134 | char * | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
135 | quote_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 ((
| 0-49171180 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
147 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
148 | temp[0] = '\0'; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
149 | return executed 8219675 times by 1 test: temp;return temp; Executed by:
executed 8219675 times by 1 test: return temp; Executed by:
| 8219675 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
150 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
151 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
152 | cclass = collsym = equiv = last_was_backslash = 0; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
153 | for (i = j = 0; pathname[i]
| 40952302-115655548 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
154 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
155 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
156 | if (pathname[i] == '\001'
| 0-87526480 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
157 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
158 | temp[j++] = pathname[i++]; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
159 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
160 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
161 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
162 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
163 | else if ((
| 24-87537666 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
164 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
165 | i++; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
166 | temp[j++] = pathname[i]; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
167 | continue; executed 24 times by 1 test: continue; Executed by:
| 24 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
168 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
169 | else if (pathname[i] == '\001'
| 28129068-87526456 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
170 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
171 | if ((
| 0-87526424 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
172 | continue; never executed: continue; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
173 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
174 | if (pathname[i+1] != '\001'
| 64-87526392 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
175 | continue; executed 125 times by 1 test: continue; Executed by:
| 125 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
176 | temp[j++] = '\\'; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
177 | i++; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
178 | if (pathname[i] == '\0'
| 0-87526331 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
179 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
180 | } executed 87526331 times by 1 test: end of block Executed by:
| 87526331 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
181 | else if ((
| 39-28128729 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
182 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
183 | temp[j++] = pathname[i++]; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
184 | savej = j; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
185 | savei = i; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
186 | c = pathname[i++]; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
187 | if (c == '^'
| 7-32 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
188 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
189 | temp[j++] = c; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
190 | c = pathname[i++]; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
191 | } executed 7 times by 1 test: end of block Executed by:
| 7 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
192 | if (c == ']'
| 1-38 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
193 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
194 | temp[j++] = c; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
195 | c = pathname[i++]; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
196 | } executed 1 time by 1 test: end of block Executed by:
| 1 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
197 | do | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
198 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
199 | if (c == 0
| 0-146 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
200 | goto never executed: endpat;goto endpat; never executed: goto endpat; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
201 | else if (c == '\001'
| 16-130 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
202 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
203 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
204 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
205 | if (pathname[i] == 0
| 0-16 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
206 | goto never executed: endpat;goto endpat; never executed: goto endpat; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
207 | temp[j++] = pathname[i++]; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
208 | } executed 16 times by 1 test: end of block Executed by:
| 16 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
209 | else if (c == '['
| 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:
| 9 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
215 | else if (cclass
| 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:
| 9 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
221 | else if (c == '['
| 6-98 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
222 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
223 | temp[j++] = c; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
224 | temp[j++] = pathname[i++]; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
225 | if (pathname[i] == ']'
| 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:
| 6 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
229 | else if (equiv
| 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:
| 6 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
235 | else if (c == '['
| 0-92 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
236 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
237 | temp[j++] = c; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
238 | temp[j++] = pathname[i++]; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
239 | if (pathname[i] == ']'
| 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:
| 8 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
243 | else if (collsym
| 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:
| 8 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
249 | else | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
250 | temp[j++] = c; executed 84 times by 1 test: temp[j++] = c; Executed by:
| 84 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
251 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
252 | while (((
| 1-108 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
253 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
254 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
255 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
256 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
257 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
258 | if (c == 0
| 1-38 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
259 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
260 | i = savei - 1; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
261 | j = savej; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
262 | continue; executed 1 time by 1 test: continue; Executed by:
| 1 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
263 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
264 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
265 | temp[j++] = c; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
266 | i--; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
267 | continue; executed 38 times by 1 test: continue; Executed by:
| 38 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
268 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
269 | else if (pathname[i] == '\\'
| 9-28128919 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
270 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
271 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
272 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
273 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
274 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
275 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
276 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
277 | temp[j++] = '\\'; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
278 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
279 | i++; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
280 | if (pathname[i] == '\0'
| 8-93 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
281 | break; executed 8 times by 1 test: break; Executed by:
| 8 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
282 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
283 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
284 | if ((
| 0-55 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
285 | i++; executed 4 times by 1 test: i++; Executed by:
| 4 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
286 | } executed 93 times by 1 test: end of block Executed by:
| 93 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
287 | else if (pathname[i] == '\\'
| 0-28128919 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
288 | last_was_backslash = 1; executed 9 times by 1 test: last_was_backslash = 1; Executed by:
| 9 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
289 | temp[j++] = pathname[i]; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
290 | } executed 115655352 times by 1 test: end of block Executed by:
| 115655352 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
291 | endpat: code before this statement executed 40952310 times by 1 test: endpat: Executed by:
| 40952310 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
292 | temp[j] = '\0'; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
293 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
294 | return executed 40952310 times by 1 test: (temp);return (temp); Executed by:
executed 40952310 times by 1 test: return (temp); Executed by:
| 40952310 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
295 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
296 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
297 | char * | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
298 | quote_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; *
| 5-109 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
311 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
312 | if (glob_char_p (s)
| 9-100 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
313 | * executed 9 times by 1 test: t++ = '\\';*t++ = '\\'; Executed by:
executed 9 times by 1 test: *t++ = '\\'; Executed by:
| 9 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
314 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
315 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
316 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
317 | do { if (locale_mb_cur_max > 1
executed 42 times by 1 test: else if (locale_utf8localemblength = 1; Executed by:
executed 1 time by 1 test: else { state_bak = state; mblength = mbrlen ((s), (send) - (s), &state); }mblength = 1; Executed by:
never executed: if (mblength == (size_t)-2end of block
never executed: else mblength = (end of block
executed 43 times by 1 test: for (_k = 0; _k < mblengthmblength = (mblength < 1) ? 1 : mblength; Executed by:
executed 43 times by 1 test: t)++ = *(s)++;*(t)++ = *(s)++; Executed by:
executed 43 times by 1 test: }*(t)++ = *(s)++; Executed by:
executed 43 times by 1 test: else *(end of block Executed by:
executed 66 times by 1 test: t)++ = *(s)++;*(t)++ = *(s)++; Executed by:
executed 66 times by 1 test: } while (0);*(t)++ = *(s)++; Executed by:
| 0-66 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
318 | } executed 109 times by 1 test: end of block Executed by:
| 109 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
319 | *t = '\0'; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
320 | return executed 5 times by 1 test: temp;return temp; Executed by:
executed 5 times by 1 test: return temp; Executed by:
| 5 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
321 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
322 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
323 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
324 | char ** | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
325 | shell_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
| 25-780 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
335 | results = glob_filename (temp, gflags); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
336 | sh_xfree((temp), "pathexp.c", 429); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
337 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
338 | if (results
| 0-805 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
339 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
340 | if (should_ignore_glob_matches ()
| 4-744 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
341 | ignore_glob_matches (results); executed 4 times by 1 test: ignore_glob_matches (results); Executed by:
| 4 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
342 | if (results
| 0-748 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
343 | strvec_sort (results); executed 110 times by 1 test: strvec_sort (results); Executed by:
| 110 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
344 | else | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
345 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
346 | do { if (results
executed 638 times by 1 test: } while (0);sh_xfree((results), "pathexp.c", 439); Executed by:
| 0-638 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
347 | results = (char **)&glob_error_return; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
348 | } executed 638 times by 1 test: end of block Executed by:
| 638 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
349 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
350 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
351 | return executed 805 times by 1 test: (results);return (results); Executed by:
executed 805 times by 1 test: return (results); Executed by:
| 805 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
352 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
353 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
354 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
355 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
356 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
357 | static 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 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
369 | void | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
370 | setup_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
| 4-18 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
379 | glob_dot_filenames = 1; executed 4 times by 1 test: glob_dot_filenames = 1; Executed by:
| 4 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
380 | else if (v == 0
| 1-17 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
381 | glob_dot_filenames = 0; executed 17 times by 1 test: glob_dot_filenames = 0; Executed by:
| 17 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
382 | } executed 22 times by 1 test: end of block Executed by:
| 22 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
383 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
384 | int | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
385 | should_ignore_glob_matches () | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
386 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
387 | return executed 748 times by 1 test: globignore.num_ignores;return globignore.num_ignores; Executed by:
executed 748 times by 1 test: return globignore.num_ignores; Executed by:
| 748 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
388 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
389 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
390 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
391 | static int | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
392 | glob_name_is_acceptable (name) | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
393 | const char *name; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
394 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
395 | struct ign *p; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
396 | int flags; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
397 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
398 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
399 | if (name[0] == '.'
| 0-62 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
400 | return never executed: (0);return (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
| 19-184 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
404 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
405 | if (strmatch (p->val, (char *)name, flags) != 1
| 49-135 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
406 | return executed 49 times by 1 test: (0);return (0); Executed by:
executed 49 times by 1 test: return (0); Executed by:
| 49 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
407 | } executed 135 times by 1 test: end of block Executed by:
| 135 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
408 | return executed 19 times by 1 test: (1);return (1); Executed by:
executed 19 times by 1 test: return (1); Executed by:
| 19 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
409 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
410 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
411 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
412 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
413 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
414 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
415 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
416 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
417 | static void | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
418 | ignore_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]
| 4-68 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
426 | ; executed 68 times by 1 test: ; Executed by:
| 68 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
427 | newnames = strvec_create (i + 1); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
428 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
429 | for (n = i = 0; names[i]
| 4-68 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
430 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
431 | if ((*
| 19-49 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
432 | newnames[n++] = names[i]; executed 19 times by 1 test: newnames[n++] = names[i]; Executed by:
| 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:
| 49 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
435 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
436 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
437 | newnames[n] = (char *) | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
438 | ((void *)0) | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
439 | ; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
440 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
441 | if (n == 0
| 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:
| 2 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
448 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
449 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
450 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
451 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
452 | for (n = 0; newnames[n]
| 2-19 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
453 | names[n] = newnames[n]; executed 19 times by 1 test: names[n] = newnames[n]; Executed by:
| 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:
| 2 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
459 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
460 | void | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
461 | ignore_glob_matches (names) | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
462 | char **names; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
463 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
464 | if (globignore.num_ignores == 0
| 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:
| 4 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
469 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
470 | static char * | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
471 | split_ignorespec (s, ip) | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
472 | char *s; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
473 | int *ip; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
474 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
475 | char *t; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
476 | int n, i; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
477 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
478 | if (s == 0
| 0-26 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
479 | return never executed: 0;return 0; never executed: return 0; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
480 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
481 | i = *ip; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
482 | if (s[i] == 0
| 6-20 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
483 | return executed 6 times by 1 test: 0;return 0; Executed by:
executed 6 times by 1 test: return 0; Executed by:
| 6 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
484 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
485 | n = skip_to_delim (s, i, ":", 0x001|0x010|0x040); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
486 | t = substring (s, i, n); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
487 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
488 | if (s[n] == ':'
| 6-14 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
489 | n++; executed 14 times by 1 test: n++; Executed by:
| 14 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
490 | *ip = n; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
491 | return executed 20 times by 1 test: t;return t; Executed by:
executed 20 times by 1 test: return t; Executed by:
| 20 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
492 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
493 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
494 | void | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
495 | setup_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
| 0-50 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
506 | __extension__ ({ size_t __s1_len, __s2_len; (__builtin_constant_p (
| 2-3 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
507 | this_ignoreval
| 2-3 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
508 | ) && __builtin_constant_p (
| 2-3 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
509 | ivp->last_ignoreval
| 2-3 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
510 | ) && (__s1_len = __builtin_strlen (
| 2-3 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
511 | this_ignoreval
| 2-3 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
512 | ), __s2_len = __builtin_strlen (
| 2-3 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
513 | ivp->last_ignoreval
| 2-3 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
514 | ), (!((size_t)(const void *)((
| 2-3 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
515 | this_ignoreval
| 2-3 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
516 | ) + 1) - (size_t)(const void *)(
| 2-3 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
517 | this_ignoreval
| 2-3 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
518 | ) == 1) || __s1_len >= 4) && (!((size_t)(const void *)((
| 2-3 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
519 | ivp->last_ignoreval
| 2-3 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
520 | ) + 1) - (size_t)(const void *)(
| 2-3 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
521 | ivp->last_ignoreval
| 2-3 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
522 | ) == 1) || __s2_len >= 4)) ? __builtin_strcmp (
| 2-3 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
523 | this_ignoreval
| 2-3 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
524 | ,
| 2-3 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
525 | ivp->last_ignoreval
| 2-3 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
526 | ) : (__builtin_constant_p (
| 2-3 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
527 | this_ignoreval
| 2-3 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
528 | ) && ((size_t)(const void *)((
| 2-3 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
529 | this_ignoreval
| 2-3 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
530 | ) + 1) - (size_t)(const void *)(
| 2-3 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
531 | this_ignoreval
| 2-3 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
532 | ) == 1) && (__s1_len = __builtin_strlen (
| 2-3 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
533 | this_ignoreval
| 2-3 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
534 | ), __s1_len < 4) ? (__builtin_constant_p (
| 2-3 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
535 | ivp->last_ignoreval
| 2-3 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
536 | ) && ((size_t)(const void *)((
| 2-3 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
537 | ivp->last_ignoreval
| 2-3 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
538 | ) + 1) - (size_t)(const void *)(
| 2-3 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
539 | ivp->last_ignoreval
| 2-3 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
540 | ) == 1) ? __builtin_strcmp (
| 2-3 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
541 | this_ignoreval
| 2-3 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
542 | ,
| 2-3 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
543 | ivp->last_ignoreval
| 2-3 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
544 | ) : (__extension__ ({ const unsigned char *__s2 = (const unsigned char *) (const char *) (
| 2-3 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
545 | ivp->last_ignoreval
| 2-3 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
546 | ); int __result = (((const unsigned char *) (const char *) (
| 2-3 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
547 | this_ignoreval
| 2-3 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
548 | ))[0] - __s2[0]); if (__s1_len > 0
| 0-3 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
549 | this_ignoreval
| 2-3 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
550 | ))[1] - __s2[1]); if (__s1_len > 1
| 0-3 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
551 | this_ignoreval
| 2-3 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
552 | ))[2] - __s2[2]); if (__s1_len > 2
never executed: __result = (((const unsigned char *) (const char *) ( this_ignoreval ))[3] - __s2[3]);
| 0-3 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
553 | this_ignoreval
never executed: __result = (((const unsigned char *) (const char *) ( this_ignoreval ))[3] - __s2[3]); | 0-3 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
554 | ))[3] - __s2[3]);
never executed: }__result = (((const unsigned char *) (const char *) ( this_ignoreval ))[3] - __s2[3]); never executed: }end of block never executed: __result; }))) : (__builtin_constant_p (end of block
| 0-3 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
555 | ivp->last_ignoreval
| 2-3 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
556 | ) && ((size_t)(const void *)((
| 2-3 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
557 | ivp->last_ignoreval
| 2-3 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
558 | ) + 1) - (size_t)(const void *)(
| 2-3 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
559 | ivp->last_ignoreval
| 2-3 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
560 | ) == 1) && (__s2_len = __builtin_strlen (
| 2-3 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
561 | ivp->last_ignoreval
| 2-3 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
562 | ), __s2_len < 4) ? (__builtin_constant_p (
| 2-3 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
563 | this_ignoreval
| 2-3 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
564 | ) && ((size_t)(const void *)((
| 2-3 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
565 | this_ignoreval
| 2-3 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
566 | ) + 1) - (size_t)(const void *)(
| 2-3 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
567 | this_ignoreval
| 2-3 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
568 | ) == 1) ? __builtin_strcmp (
| 2-3 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
569 | this_ignoreval
| 2-3 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
570 | ,
| 2-3 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
571 | ivp->last_ignoreval
| 2-3 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
572 | ) : -(__extension__ ({ const unsigned char *__s2 = (const unsigned char *) (const char *) (
| 2-3 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
573 | this_ignoreval
| 2-3 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
574 | ); int __result = (((const unsigned char *) (const char *) (
| 2-3 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
575 | ivp->last_ignoreval
| 2-3 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
576 | ))[0] - __s2[0]); if (__s2_len > 0
| 0-3 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
577 | ivp->last_ignoreval
| 2-3 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
578 | ))[1] - __s2[1]); if (__s2_len > 1
| 0-3 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
579 | ivp->last_ignoreval
| 2-3 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
580 | ))[2] - __s2[2]); if (__s2_len > 2
never executed: __result = (((const unsigned char *) (const char *) ( ivp->last_ignoreval ))[3] - __s2[3]);
| 0-3 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
581 | ivp->last_ignoreval
never executed: __result = (((const unsigned char *) (const char *) ( ivp->last_ignoreval ))[3] - __s2[3]); | 0-3 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
582 | ))[3] - __s2[3]);
never executed: }__result = (((const unsigned char *) (const char *) ( ivp->last_ignoreval ))[3] - __s2[3]); never executed: }end of block never executed: __result; }))) : __builtin_strcmp (end of block
| 0-3 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
583 | this_ignoreval
| 2-3 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
584 | ,
| 2-3 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
585 | ivp->last_ignoreval
| 2-3 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
586 | )))); })
| 2-3 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
587 | == 0
| 2-3 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
588 | (!this_ignoreval
| 1-50 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
589 | return; executed 52 times by 1 test: return; Executed by:
| 52 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
590 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
591 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
592 | ivp->num_ignores = 0; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
593 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
594 | if (ivp->ignores
| 3-5 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
595 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
596 | for (p = ivp->ignores; p->val
| 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:
| 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:
| 3 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
603 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
604 | if (ivp->last_ignoreval
| 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:
| 3 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
611 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
612 | if (this_ignoreval == 0
| 1-7 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
613 | return; executed 2 times by 1 test: return; Executed by:
| 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)
| 6-20 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
623 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
624 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
625 | if (numitems + 1 >= maxitems
| 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:
| 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
| 7-13 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
634 | (* executed 7 times by 1 test: ivp->item_func) (&ivp->ignores[numitems]);(*ivp->item_func) (&ivp->ignores[numitems]); Executed by:
executed 7 times by 1 test: (*ivp->item_func) (&ivp->ignores[numitems]); Executed by:
| 7 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
635 | numitems++; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
636 | } executed 20 times by 1 test: end of block Executed by:
| 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:
| 6 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Switch to Source code | Preprocessed file |