Line | Source | Count |
1 | | - |
2 | | - |
3 | | - |
4 | | - |
5 | | - |
6 | | - |
7 | | - |
8 | | - |
9 | | - |
10 | | - |
11 | | - |
12 | | - |
13 | | - |
14 | | - |
15 | | - |
16 | typedef int _hist_search_func_t (const char *, int); | - |
17 | | - |
18 | static char error_pointer; | - |
19 | | - |
20 | static char *subst_lhs; | - |
21 | static char *subst_rhs; | - |
22 | static int subst_lhs_len; | - |
23 | static int subst_rhs_len; | - |
24 | | - |
25 | | - |
26 | | - |
27 | static char *history_event_delimiter_chars = "^$*%-"; | - |
28 | | - |
29 | static char *get_history_word_specifier (char *, char *, int *); | - |
30 | static int history_tokenize_word (const char *, int); | - |
31 | static char **history_tokenize_internal (const char *, int, int *); | - |
32 | static char *history_substring (const char *, int, int); | - |
33 | static void freewords (char **, int); | - |
34 | static char *history_find_word (char *, int); | - |
35 | | - |
36 | static char *quote_breaks (char *); | - |
37 | | - |
38 | | - |
39 | | - |
40 | | - |
41 | char history_expansion_char = '!'; | - |
42 | | - |
43 | | - |
44 | | - |
45 | char history_subst_char = '^'; | - |
46 | | - |
47 | | - |
48 | | - |
49 | | - |
50 | | - |
51 | char history_comment_char = '\0'; | - |
52 | | - |
53 | | - |
54 | | - |
55 | char *history_no_expand_chars = " \t\n\r="; | - |
56 | | - |
57 | | - |
58 | | - |
59 | int history_quotes_inhibit_expansion = 0; | - |
60 | | - |
61 | | - |
62 | char *history_word_delimiters = " \t\n;&()|<>"; | - |
63 | | - |
64 | | - |
65 | | - |
66 | rl_linebuf_func_t *history_inhibit_expansion_function; | - |
67 | static char *search_string; | - |
68 | | - |
69 | static char *search_match; | - |
70 | char * | - |
71 | get_history_event (const char *string, int *caller_index, int delimiting_quote) | - |
72 | { | - |
73 | register int i; | - |
74 | register char c; | - |
75 | HIST_ENTRY *entry; | - |
76 | int which, sign, local_index, substring_okay; | - |
77 | _hist_search_func_t *search_func; | - |
78 | char *temp; | - |
79 | i = *caller_index; | - |
80 | | - |
81 | if (string[i] != history_expansion_charTRUE | never evaluated | FALSE | evaluated 135 times by 1 test |
) | 0-135 |
82 | return never executed: return ((char *) ((void *)0) ); ((char *)never executed: return ((char *) ((void *)0) ); | 0 |
83 | ((void *)0) never executed: return ((char *) ((void *)0) ); | 0 |
84 | ); never executed: return ((char *) ((void *)0) ); | 0 |
85 | | - |
86 | | - |
87 | i++; | - |
88 | | - |
89 | sign = 1; | - |
90 | substring_okay = 0; | - |
91 | | - |
92 | | - |
93 | | - |
94 | | - |
95 | | - |
96 | if (string[i] == history_expansion_charTRUE | evaluated 109 times by 1 test | FALSE | evaluated 26 times by 1 test |
) | 26-109 |
97 | { | - |
98 | i++; | - |
99 | which = history_base + (history_length - 1); | - |
100 | *caller_index = i; | - |
101 | returnexecuted 109 times by 1 test: return ((entry = history_get (which)) ? entry->line : (char *) ((void *)0) ); ((entry = history_get (which)) ? entry->line : (char *)executed 109 times by 1 test: return ((entry = history_get (which)) ? entry->line : (char *) ((void *)0) ); | 109 |
102 | ((void *)0)executed 109 times by 1 test: return ((entry = history_get (which)) ? entry->line : (char *) ((void *)0) ); | 109 |
103 | );executed 109 times by 1 test: return ((entry = history_get (which)) ? entry->line : (char *) ((void *)0) ); | 109 |
104 | } | - |
105 | | - |
106 | | - |
107 | if (string[i] == '-'TRUE | evaluated 13 times by 1 test | FALSE | evaluated 13 times by 1 test |
) | 13 |
108 | { | - |
109 | sign = -1; | - |
110 | i++; | - |
111 | }executed 13 times by 1 test: end of block | 13 |
112 | | - |
113 | if (((TRUE | evaluated 25 times by 1 test | FALSE | evaluated 1 time by 1 test |
string[i]) >= '0'TRUE | evaluated 25 times by 1 test | FALSE | evaluated 1 time by 1 test |
&& (TRUE | evaluated 14 times by 1 test | FALSE | evaluated 11 times by 1 test |
string[i]) <= '9'TRUE | evaluated 14 times by 1 test | FALSE | evaluated 11 times by 1 test |
)) | 1-25 |
114 | { | - |
115 | | - |
116 | for (which = 0; ((TRUE | evaluated 26 times by 1 test | FALSE | evaluated 2 times by 1 test |
string[i]) >= '0'TRUE | evaluated 26 times by 1 test | FALSE | evaluated 2 times by 1 test |
&& (TRUE | evaluated 14 times by 1 test | FALSE | evaluated 12 times by 1 test |
string[i]) <= '9'TRUE | evaluated 14 times by 1 test | FALSE | evaluated 12 times by 1 test |
); i++) | 2-26 |
117 | which = (which * 10) + ((string[i]) - '0');executed 14 times by 1 test: which = (which * 10) + ((string[i]) - '0'); | 14 |
118 | | - |
119 | *caller_index = i; | - |
120 | | - |
121 | if (sign < 0TRUE | evaluated 13 times by 1 test | FALSE | evaluated 1 time by 1 test |
) | 1-13 |
122 | which = (history_length + history_base) - which;executed 13 times by 1 test: which = (history_length + history_base) - which; | 13 |
123 | | - |
124 | returnexecuted 14 times by 1 test: return ((entry = history_get (which)) ? entry->line : (char *) ((void *)0) ); ((entry = history_get (which)) ? entry->line : (char *)executed 14 times by 1 test: return ((entry = history_get (which)) ? entry->line : (char *) ((void *)0) ); | 14 |
125 | ((void *)0)executed 14 times by 1 test: return ((entry = history_get (which)) ? entry->line : (char *) ((void *)0) ); | 14 |
126 | );executed 14 times by 1 test: return ((entry = history_get (which)) ? entry->line : (char *) ((void *)0) ); | 14 |
127 | } | - |
128 | | - |
129 | | - |
130 | | - |
131 | | - |
132 | if (string[i] == '?'TRUE | evaluated 5 times by 1 test | FALSE | evaluated 7 times by 1 test |
) | 5-7 |
133 | { | - |
134 | substring_okay++; | - |
135 | i++; | - |
136 | }executed 5 times by 1 test: end of block | 5 |
137 | | - |
138 | | - |
139 | for (local_index = i; c = string[i]TRUE | evaluated 31 times by 1 test | FALSE | evaluated 4 times by 1 test |
; i++) | 4-31 |
140 | { | - |
141 | | - |
142 | if ( | - |
143 | (TRUE | evaluated 2 times by 1 test | FALSE | evaluated 29 times by 1 test |
__ctype_get_mb_cur_max ()) TRUE | evaluated 2 times by 1 test | FALSE | evaluated 29 times by 1 test |
| 2-29 |
144 | > 1TRUE | evaluated 2 times by 1 test | FALSE | evaluated 29 times by 1 test |
&& rl_byte_oriented == 0TRUE | evaluated 2 times by 1 test | FALSE | never evaluated |
) | 0-29 |
145 | { | - |
146 | int v; | - |
147 | mbstate_t ps; | - |
148 | | - |
149 | memset (&ps, 0, sizeof (mbstate_t)); | - |
150 | | - |
151 | | - |
152 | _rl_adjust_point ((char *)string, i, &ps); | - |
153 | if ((TRUE | never evaluated | FALSE | evaluated 2 times by 1 test |
v = _rl_get_char_len ((char *)string + i, &ps)) > 1TRUE | never evaluated | FALSE | evaluated 2 times by 1 test |
) | 0-2 |
154 | { | - |
155 | i += v - 1; | - |
156 | continue; never executed: continue; | 0 |
157 | } | - |
158 | }executed 2 times by 1 test: end of block | 2 |
159 | | - |
160 | | - |
161 | if ((!substring_okayTRUE | evaluated 18 times by 1 test | FALSE | evaluated 13 times by 1 test |
&& ((((TRUE | never evaluated | FALSE | evaluated 18 times by 1 test |
c) == ' ')TRUE | never evaluated | FALSE | evaluated 18 times by 1 test |
|| ((TRUE | never evaluated | FALSE | evaluated 18 times by 1 test |
c) == '\t')TRUE | never evaluated | FALSE | evaluated 18 times by 1 test |
) || c == ':'TRUE | never evaluated | FALSE | evaluated 18 times by 1 test |
|| | 0-18 |
162 | (history_event_delimiter_charsTRUE | evaluated 18 times by 1 test | FALSE | never evaluated |
&& ((TRUE | evaluated 18 times by 1 test | FALSE | never evaluated |
TRUE | evaluated 2 times by 1 test | FALSE | evaluated 16 times by 1 test |
c)TRUE | evaluated 18 times by 1 test | FALSE | never evaluated |
? ((char *)TRUE | evaluated 2 times by 1 test | FALSE | evaluated 16 times by 1 test |
| 0-18 |
163 | (__extension__ (__builtin_constant_p (TRUE | evaluated 2 times by 1 test | FALSE | evaluated 16 times by 1 test |
| 2-16 |
164 | (c)TRUE | evaluated 2 times by 1 test | FALSE | evaluated 16 times by 1 test |
| 2-16 |
165 | ) && !__builtin_constant_p (TRUE | evaluated 2 times by 1 test | FALSE | evaluated 16 times by 1 test |
| 2-16 |
166 | (history_event_delimiter_chars)TRUE | evaluated 2 times by 1 test | FALSE | evaluated 16 times by 1 test |
| 2-16 |
167 | ) && (TRUE | evaluated 2 times by 1 test | FALSE | evaluated 16 times by 1 test |
| 2-16 |
168 | (c)TRUE | evaluated 2 times by 1 test | FALSE | evaluated 16 times by 1 test |
| 2-16 |
169 | ) == '\0' ? (char *) __rawmemchr (TRUE | evaluated 2 times by 1 test | FALSE | evaluated 16 times by 1 test |
| 2-16 |
170 | (history_event_delimiter_chars)TRUE | evaluated 2 times by 1 test | FALSE | evaluated 16 times by 1 test |
| 2-16 |
171 | , TRUE | evaluated 2 times by 1 test | FALSE | evaluated 16 times by 1 test |
| 2-16 |
172 | (c)TRUE | evaluated 2 times by 1 test | FALSE | evaluated 16 times by 1 test |
| 2-16 |
173 | ) : __builtin_strchr (TRUE | evaluated 2 times by 1 test | FALSE | evaluated 16 times by 1 test |
| 2-16 |
174 | (history_event_delimiter_chars)TRUE | evaluated 2 times by 1 test | FALSE | evaluated 16 times by 1 test |
| 2-16 |
175 | , TRUE | evaluated 2 times by 1 test | FALSE | evaluated 16 times by 1 test |
| 2-16 |
176 | (c)TRUE | evaluated 2 times by 1 test | FALSE | evaluated 16 times by 1 test |
| 2-16 |
177 | ))) TRUE | evaluated 2 times by 1 test | FALSE | evaluated 16 times by 1 test |
| 2-16 |
178 | != (char *)TRUE | evaluated 2 times by 1 test | FALSE | evaluated 16 times by 1 test |
| 2-16 |
179 | ((void *)0)TRUE | evaluated 2 times by 1 test | FALSE | evaluated 16 times by 1 test |
| 2-16 |
180 | ) : 0)TRUE | evaluated 2 times by 1 test | FALSE | evaluated 16 times by 1 test |
) || | 2-16 |
181 | (history_search_delimiter_charsTRUE | evaluated 14 times by 1 test | FALSE | evaluated 2 times by 1 test |
&& ((TRUE | never evaluated | FALSE | evaluated 14 times by 1 test |
c) ? ((char *)TRUE | never evaluated | FALSE | evaluated 14 times by 1 test |
| 0-14 |
182 | (__extension__ (__builtin_constant_p (TRUE | never evaluated | FALSE | evaluated 14 times by 1 test |
| 0-14 |
183 | (c)TRUE | never evaluated | FALSE | evaluated 14 times by 1 test |
| 0-14 |
184 | ) && !__builtin_constant_p (TRUE | never evaluated | FALSE | evaluated 14 times by 1 test |
| 0-14 |
185 | (history_search_delimiter_chars)TRUE | never evaluated | FALSE | evaluated 14 times by 1 test |
| 0-14 |
186 | ) && (TRUE | never evaluated | FALSE | evaluated 14 times by 1 test |
| 0-14 |
187 | (c)TRUE | never evaluated | FALSE | evaluated 14 times by 1 test |
| 0-14 |
188 | ) == '\0' ? (char *) __rawmemchr (TRUE | never evaluated | FALSE | evaluated 14 times by 1 test |
| 0-14 |
189 | (history_search_delimiter_chars)TRUE | never evaluated | FALSE | evaluated 14 times by 1 test |
| 0-14 |
190 | , TRUE | never evaluated | FALSE | evaluated 14 times by 1 test |
| 0-14 |
191 | (c)TRUE | never evaluated | FALSE | evaluated 14 times by 1 test |
| 0-14 |
192 | ) : __builtin_strchr (TRUE | never evaluated | FALSE | evaluated 14 times by 1 test |
| 0-14 |
193 | (history_search_delimiter_chars)TRUE | never evaluated | FALSE | evaluated 14 times by 1 test |
| 0-14 |
194 | , TRUE | never evaluated | FALSE | evaluated 14 times by 1 test |
| 0-14 |
195 | (c)TRUE | never evaluated | FALSE | evaluated 14 times by 1 test |
| 0-14 |
196 | ))) TRUE | never evaluated | FALSE | evaluated 14 times by 1 test |
| 0-14 |
197 | != (char *)TRUE | never evaluated | FALSE | evaluated 14 times by 1 test |
| 0-14 |
198 | ((void *)0)TRUE | never evaluated | FALSE | evaluated 14 times by 1 test |
| 0-14 |
199 | ) : 0)TRUE | never evaluated | FALSE | evaluated 14 times by 1 test |
) || | 0-14 |
200 | string[i] == delimiting_quoteTRUE | evaluated 1 time by 1 test | FALSE | evaluated 15 times by 1 test |
)) || | 1-15 |
201 | string[i] == '\n'TRUE | never evaluated | FALSE | evaluated 28 times by 1 test |
|| | 0-28 |
202 | (substring_okayTRUE | evaluated 13 times by 1 test | FALSE | evaluated 15 times by 1 test |
&& string[i] == '?'TRUE | evaluated 5 times by 1 test | FALSE | evaluated 8 times by 1 test |
)) | 5-15 |
203 | break;executed 8 times by 1 test: break; | 8 |
204 | }executed 23 times by 1 test: end of block | 23 |
205 | | - |
206 | which = i - local_index; | - |
207 | temp = (char *)xmalloc (1 + which); | - |
208 | if (whichTRUE | evaluated 12 times by 1 test | FALSE | never evaluated |
) | 0-12 |
209 | | - |
210 | __builtin_strncpy (executed 12 times by 1 test: __builtin_strncpy ( temp , string + local_index , which ) ; | 12 |
211 | tempexecuted 12 times by 1 test: __builtin_strncpy ( temp , string + local_index , which ) ; | 12 |
212 | , executed 12 times by 1 test: __builtin_strncpy ( temp , string + local_index , which ) ; | 12 |
213 | string + local_indexexecuted 12 times by 1 test: __builtin_strncpy ( temp , string + local_index , which ) ; | 12 |
214 | , executed 12 times by 1 test: __builtin_strncpy ( temp , string + local_index , which ) ; | 12 |
215 | whichexecuted 12 times by 1 test: __builtin_strncpy ( temp , string + local_index , which ) ; | 12 |
216 | )executed 12 times by 1 test: __builtin_strncpy ( temp , string + local_index , which ) ; | 12 |
217 | ;executed 12 times by 1 test: __builtin_strncpy ( temp , string + local_index , which ) ; | 12 |
218 | temp[which] = '\0'; | - |
219 | | - |
220 | if (substring_okayTRUE | evaluated 5 times by 1 test | FALSE | evaluated 7 times by 1 test |
&& string[i] == '?'TRUE | evaluated 5 times by 1 test | FALSE | never evaluated |
) | 0-7 |
221 | i++;executed 5 times by 1 test: i++; | 5 |
222 | | - |
223 | *caller_index = i; | - |
224 | if (*TRUE | never evaluated | FALSE | evaluated 12 times by 1 test |
temp == '\0'TRUE | never evaluated | FALSE | evaluated 12 times by 1 test |
&& substring_okayTRUE | never evaluated | FALSE | never evaluated |
) | 0-12 |
225 | { | - |
226 | if (search_stringTRUE | never evaluated | FALSE | never evaluated |
) | 0 |
227 | { | - |
228 | xfree (temp); | - |
229 | temp = strcpy (xmalloc (1 + strlen (search_string)), (search_string)); | - |
230 | } never executed: end of block | 0 |
231 | else | - |
232 | do { history_offset = history_length; xfree (temp) ; return never executed: return (char *) ((void *)0) ; (char *)never executed: return (char *) ((void *)0) ; | 0 |
233 | ((void *)0) never executed: return (char *) ((void *)0) ; | 0 |
234 | ; never executed: return (char *) ((void *)0) ; }never executed: end of block while (0); | 0 |
235 | } | - |
236 | | - |
237 | search_func = substring_okayTRUE | evaluated 5 times by 1 test | FALSE | evaluated 7 times by 1 test |
? history_search : history_search_prefix; | 5-7 |
238 | while (1) | - |
239 | { | - |
240 | local_index = (*search_func) (temp, -1); | - |
241 | | - |
242 | if (local_index < 0TRUE | evaluated 1 time by 1 test | FALSE | evaluated 11 times by 1 test |
) | 1-11 |
243 | do { history_offset = history_length; xfree (temp) ; returnexecuted 1 time by 1 test: return (char *) ((void *)0) ; (char *)executed 1 time by 1 test: return (char *) ((void *)0) ; | 1 |
244 | ((executed 1 time by 1 test: return (char *) ((void *)0) ; executed 1 time by 1 test: return (char *) ((void *)0) ; void *)0)executed 1 time by 1 test: return (char *) ((void *)0) ; | 1 |
245 | ;executed 1 time by 1 test: return (char *) ((void *)0) ; }never executed: end of block while (0); | 0-1 |
246 | | - |
247 | if (local_index == 0TRUE | evaluated 6 times by 1 test | FALSE | evaluated 5 times by 1 test |
|| substring_okayTRUE | evaluated 5 times by 1 test | FALSE | never evaluated |
) | 0-6 |
248 | { | - |
249 | entry = current_history (); | - |
250 | if (entry == 0TRUE | never evaluated | FALSE | evaluated 11 times by 1 test |
) | 0-11 |
251 | do { history_offset = history_length; xfree (temp) ; return never executed: return (char *) ((void *)0) ; (char *)never executed: return (char *) ((void *)0) ; | 0 |
252 | ((void *)0) never executed: return (char *) ((void *)0) ; | 0 |
253 | ; never executed: return (char *) ((void *)0) ; }never executed: end of block while (0); | 0 |
254 | history_offset = history_length; | - |
255 | | - |
256 | | - |
257 | | - |
258 | if (substring_okayTRUE | evaluated 5 times by 1 test | FALSE | evaluated 6 times by 1 test |
) | 5-6 |
259 | { | - |
260 | if (search_stringTRUE | evaluated 4 times by 1 test | FALSE | evaluated 1 time by 1 test |
) free (search_string);executed 4 times by 1 test: free (search_string); | 1-4 |
261 | search_string = temp; | - |
262 | | - |
263 | if (search_matchTRUE | evaluated 4 times by 1 test | FALSE | evaluated 1 time by 1 test |
) free (search_match);executed 4 times by 1 test: free (search_match); | 1-4 |
264 | search_match = history_find_word (entry->line, local_index); | - |
265 | }executed 5 times by 1 test: end of block | 5 |
266 | else | - |
267 | xfree (temp);executed 6 times by 1 test: xfree (temp); | 6 |
268 | | - |
269 | returnexecuted 11 times by 1 test: return (entry->line); (entry->line);executed 11 times by 1 test: return (entry->line); | 11 |
270 | } | - |
271 | | - |
272 | if (history_offsetTRUE | never evaluated | FALSE | never evaluated |
) | 0 |
273 | history_offset--; never executed: history_offset--; | 0 |
274 | else | - |
275 | do { history_offset = history_length; xfree (temp) ; return never executed: return (char *) ((void *)0) ; (char *)never executed: return (char *) ((void *)0) ; | 0 |
276 | (( never executed: return (char *) ((void *)0) ; never executed: return (char *) ((void *)0) ; void *)0)never executed: return (char *) ((void *)0) ; | 0 |
277 | ; never executed: return (char *) ((void *)0) ; }never executed: end of block while (0); | 0 |
278 | } | - |
279 | | - |
280 | | - |
281 | } never executed: end of block | 0 |
282 | static void | - |
283 | hist_string_extract_single_quoted (char *string, int *sindex, int flags) | - |
284 | { | - |
285 | register int i; | - |
286 | | - |
287 | for (i = *sindex; string[i]TRUE | evaluated 226 times by 1 test | FALSE | never evaluated |
&& string[i] != '\''TRUE | evaluated 171 times by 1 test | FALSE | evaluated 55 times by 1 test |
; i++) | 0-226 |
288 | { | - |
289 | if ((TRUE | evaluated 25 times by 1 test | FALSE | evaluated 146 times by 1 test |
flags & 1)TRUE | evaluated 25 times by 1 test | FALSE | evaluated 146 times by 1 test |
&& string[i] == '\\'TRUE | evaluated 1 time by 1 test | FALSE | evaluated 24 times by 1 test |
&& string[i+1]TRUE | evaluated 1 time by 1 test | FALSE | never evaluated |
) | 0-146 |
290 | i++;executed 1 time by 1 test: i++; | 1 |
291 | }executed 171 times by 1 test: end of block | 171 |
292 | | - |
293 | *sindex = i; | - |
294 | }executed 55 times by 1 test: end of block | 55 |
295 | | - |
296 | static char * | - |
297 | quote_breaks (char *s) | - |
298 | { | - |
299 | register char *p, *r; | - |
300 | char *ret; | - |
301 | int len = 3; | - |
302 | | - |
303 | for (p = s; pTRUE | evaluated 10 times by 1 test | FALSE | never evaluated |
&& *TRUE | evaluated 9 times by 1 test | FALSE | evaluated 1 time by 1 test |
pTRUE | evaluated 9 times by 1 test | FALSE | evaluated 1 time by 1 test |
; p++, len++) | 0-10 |
304 | { | - |
305 | if (*TRUE | never evaluated | FALSE | evaluated 9 times by 1 test |
p == '\''TRUE | never evaluated | FALSE | evaluated 9 times by 1 test |
) | 0-9 |
306 | len += 3; never executed: len += 3; | 0 |
307 | else if ((((*TRUE | evaluated 4 times by 1 test | FALSE | evaluated 5 times by 1 test |
p) == ' ')TRUE | evaluated 4 times by 1 test | FALSE | evaluated 5 times by 1 test |
|| ((*TRUE | never evaluated | FALSE | evaluated 5 times by 1 test |
p) == '\t')TRUE | never evaluated | FALSE | evaluated 5 times by 1 test |
) || *TRUE | never evaluated | FALSE | evaluated 5 times by 1 test |
p == '\n'TRUE | never evaluated | FALSE | evaluated 5 times by 1 test |
) | 0-5 |
308 | len += 2;executed 4 times by 1 test: len += 2; | 4 |
309 | }executed 9 times by 1 test: end of block | 9 |
310 | | - |
311 | r = ret = (char *)xmalloc (len); | - |
312 | *r++ = '\''; | - |
313 | for (p = s; pTRUE | evaluated 10 times by 1 test | FALSE | never evaluated |
&& *TRUE | evaluated 9 times by 1 test | FALSE | evaluated 1 time by 1 test |
pTRUE | evaluated 9 times by 1 test | FALSE | evaluated 1 time by 1 test |
; ) | 0-10 |
314 | { | - |
315 | if (*TRUE | never evaluated | FALSE | evaluated 9 times by 1 test |
p == '\''TRUE | never evaluated | FALSE | evaluated 9 times by 1 test |
) | 0-9 |
316 | { | - |
317 | *r++ = '\''; | - |
318 | *r++ = '\\'; | - |
319 | *r++ = '\''; | - |
320 | *r++ = '\''; | - |
321 | p++; | - |
322 | } never executed: end of block | 0 |
323 | else if ((((*TRUE | evaluated 4 times by 1 test | FALSE | evaluated 5 times by 1 test |
p) == ' ')TRUE | evaluated 4 times by 1 test | FALSE | evaluated 5 times by 1 test |
|| ((*TRUE | never evaluated | FALSE | evaluated 5 times by 1 test |
p) == '\t')TRUE | never evaluated | FALSE | evaluated 5 times by 1 test |
) || *TRUE | never evaluated | FALSE | evaluated 5 times by 1 test |
p == '\n'TRUE | never evaluated | FALSE | evaluated 5 times by 1 test |
) | 0-5 |
324 | { | - |
325 | *r++ = '\''; | - |
326 | *r++ = *p++; | - |
327 | *r++ = '\''; | - |
328 | }executed 4 times by 1 test: end of block | 4 |
329 | else | - |
330 | *executed 5 times by 1 test: *r++ = *p++; r++ = *p++;executed 5 times by 1 test: *r++ = *p++; | 5 |
331 | } | - |
332 | *r++ = '\''; | - |
333 | *r = '\0'; | - |
334 | returnexecuted 1 time by 1 test: return ret; ret;executed 1 time by 1 test: return ret; | 1 |
335 | } | - |
336 | | - |
337 | static char * | - |
338 | hist_error(char *s, int start, int current, int errtype) | - |
339 | { | - |
340 | char *temp; | - |
341 | const char *emsg; | - |
342 | int ll, elen; | - |
343 | | - |
344 | ll = current - start; | - |
345 | | - |
346 | switch (errtype) | - |
347 | { | - |
348 | caseexecuted 1 time by 1 test: case 0: 0:executed 1 time by 1 test: case 0: | 1 |
349 | emsg = "event not found"; | - |
350 | elen = 15; | - |
351 | break;executed 1 time by 1 test: break; | 1 |
352 | case never executed: case 1: 1:never executed: case 1: | 0 |
353 | emsg = "bad word specifier"; | - |
354 | elen = 18; | - |
355 | break; never executed: break; | 0 |
356 | case never executed: case 2: 2:never executed: case 2: | 0 |
357 | emsg = "substitution failed"; | - |
358 | elen = 19; | - |
359 | break; never executed: break; | 0 |
360 | caseexecuted 1 time by 1 test: case 3: 3:executed 1 time by 1 test: case 3: | 1 |
361 | emsg = "unrecognized history modifier"; | - |
362 | elen = 29; | - |
363 | break;executed 1 time by 1 test: break; | 1 |
364 | case never executed: case 4: 4:never executed: case 4: | 0 |
365 | emsg = "no previous substitution"; | - |
366 | elen = 24; | - |
367 | break; never executed: break; | 0 |
368 | default never executed: default: :never executed: default: | 0 |
369 | emsg = "unknown expansion error"; | - |
370 | elen = 23; | - |
371 | break; never executed: break; | 0 |
372 | } | - |
373 | | - |
374 | temp = (char *)xmalloc (ll + elen + 3); | - |
375 | | - |
376 | __builtin_strncpy ( | - |
377 | temp | - |
378 | , | - |
379 | s + start | - |
380 | , | - |
381 | ll | - |
382 | ) | - |
383 | ; | - |
384 | temp[ll] = ':'; | - |
385 | temp[ll + 1] = ' '; | - |
386 | strcpy (temp + ll + 2, emsg); | - |
387 | returnexecuted 2 times by 1 test: return (temp); (temp);executed 2 times by 1 test: return (temp); | 2 |
388 | } | - |
389 | static char * | - |
390 | get_subst_pattern (char *str, int *iptr, int delimiter, int is_rhs, int *lenptr) | - |
391 | { | - |
392 | register int si, i, j, k; | - |
393 | char *s; | - |
394 | | - |
395 | mbstate_t ps; | - |
396 | | - |
397 | | - |
398 | s = (char *) | - |
399 | ((void *)0) | - |
400 | ; | - |
401 | i = *iptr; | - |
402 | | - |
403 | | - |
404 | memset (&ps, 0, sizeof (mbstate_t)); | - |
405 | _rl_adjust_point (str, i, &ps); | - |
406 | | - |
407 | | - |
408 | for (si = i; str[si]TRUE | evaluated 35 times by 1 test | FALSE | evaluated 1 time by 1 test |
&& str[si] != delimiterTRUE | evaluated 26 times by 1 test | FALSE | evaluated 9 times by 1 test |
; si++) | 1-35 |
409 | | - |
410 | if ( | - |
411 | (TRUE | never evaluated | FALSE | evaluated 26 times by 1 test |
__ctype_get_mb_cur_max ()) TRUE | never evaluated | FALSE | evaluated 26 times by 1 test |
| 0-26 |
412 | > 1TRUE | never evaluated | FALSE | evaluated 26 times by 1 test |
&& rl_byte_oriented == 0TRUE | never evaluated | FALSE | never evaluated |
) | 0-26 |
413 | { | - |
414 | int v; | - |
415 | if ((TRUE | never evaluated | FALSE | never evaluated |
v = _rl_get_char_len (str + si, &ps)) > 1TRUE | never evaluated | FALSE | never evaluated |
) | 0 |
416 | si += v - 1; never executed: si += v - 1; | 0 |
417 | else if (str[si] == '\\'TRUE | never evaluated | FALSE | never evaluated |
&& str[si + 1] == delimiterTRUE | never evaluated | FALSE | never evaluated |
) | 0 |
418 | si++; never executed: si++; | 0 |
419 | } never executed: end of block | 0 |
420 | else | - |
421 | | - |
422 | if (str[si] == '\\'TRUE | never evaluated | FALSE | evaluated 26 times by 1 test |
&& str[si + 1] == delimiterTRUE | never evaluated | FALSE | never evaluated |
) | 0-26 |
423 | si++; never executed: si++; | 0 |
424 | | - |
425 | if (si > iTRUE | evaluated 10 times by 1 test | FALSE | never evaluated |
|| is_rhsTRUE | never evaluated | FALSE | never evaluated |
) | 0-10 |
426 | { | - |
427 | s = (char *)xmalloc (si - i + 1); | - |
428 | for (j = 0, k = i; k < siTRUE | evaluated 26 times by 1 test | FALSE | evaluated 10 times by 1 test |
; j++, k++) | 10-26 |
429 | { | - |
430 | | - |
431 | if (str[k] == '\\'TRUE | never evaluated | FALSE | evaluated 26 times by 1 test |
&& str[k + 1] == delimiterTRUE | never evaluated | FALSE | never evaluated |
) | 0-26 |
432 | k++; never executed: k++; | 0 |
433 | s[j] = str[k]; | - |
434 | }executed 26 times by 1 test: end of block | 26 |
435 | s[j] = '\0'; | - |
436 | if (lenptrTRUE | evaluated 10 times by 1 test | FALSE | never evaluated |
) | 0-10 |
437 | *executed 10 times by 1 test: *lenptr = j; lenptr = j;executed 10 times by 1 test: *lenptr = j; | 10 |
438 | }executed 10 times by 1 test: end of block | 10 |
439 | | - |
440 | i = si; | - |
441 | if (str[i]TRUE | evaluated 9 times by 1 test | FALSE | evaluated 1 time by 1 test |
) | 1-9 |
442 | i++;executed 9 times by 1 test: i++; | 9 |
443 | *iptr = i; | - |
444 | | - |
445 | returnexecuted 10 times by 1 test: return s; s;executed 10 times by 1 test: return s; | 10 |
446 | } | - |
447 | | - |
448 | static void | - |
449 | postproc_subst_rhs (void) | - |
450 | { | - |
451 | char *new; | - |
452 | int i, j, new_size; | - |
453 | | - |
454 | new = (char *)xmalloc (new_size = subst_rhs_len + subst_lhs_len); | - |
455 | for (i = j = 0; i < subst_rhs_lenTRUE | evaluated 2 times by 1 test | FALSE | evaluated 1 time by 1 test |
; i++) | 1-2 |
456 | { | - |
457 | if (subst_rhs[i] == '&'TRUE | evaluated 1 time by 1 test | FALSE | evaluated 1 time by 1 test |
) | 1 |
458 | { | - |
459 | if (j + subst_lhs_len >= new_sizeTRUE | never evaluated | FALSE | evaluated 1 time by 1 test |
) | 0-1 |
460 | new never executed: new = (char *)xrealloc (new, (new_size = new_size * 2 + subst_lhs_len)); = (char *)xrealloc (new, (new_size = new_size * 2 + subst_lhs_len));never executed: new = (char *)xrealloc (new, (new_size = new_size * 2 + subst_lhs_len)); | 0 |
461 | strcpy (new + j, subst_lhs); | - |
462 | j += subst_lhs_len; | - |
463 | }executed 1 time by 1 test: end of block | 1 |
464 | else | - |
465 | { | - |
466 | | - |
467 | if (subst_rhs[i] == '\\'TRUE | never evaluated | FALSE | evaluated 1 time by 1 test |
&& subst_rhs[i + 1] == '&'TRUE | never evaluated | FALSE | never evaluated |
) | 0-1 |
468 | i++; never executed: i++; | 0 |
469 | if (j >= new_sizeTRUE | never evaluated | FALSE | evaluated 1 time by 1 test |
) | 0-1 |
470 | new never executed: new = (char *)xrealloc (new, new_size *= 2); = (char *)xrealloc (new, new_size *= 2);never executed: new = (char *)xrealloc (new, new_size *= 2); | 0 |
471 | new[j++] = subst_rhs[i]; | - |
472 | }executed 1 time by 1 test: end of block | 1 |
473 | } | - |
474 | new[j] = '\0'; | - |
475 | xfree (subst_rhs); | - |
476 | subst_rhs = new; | - |
477 | subst_rhs_len = j; | - |
478 | }executed 1 time by 1 test: end of block | 1 |
479 | | - |
480 | | - |
481 | | - |
482 | | - |
483 | | - |
484 | | - |
485 | | - |
486 | static int | - |
487 | history_expand_internal (char *string, int start, int qc, int *end_index_ptr, char **ret_string, char *current_line) | - |
488 | { | - |
489 | int i, n, starting_index; | - |
490 | int substitute_globally, subst_bywords, want_quotes, print_only; | - |
491 | char *event, *temp, *result, *tstr, *t, c, *word_spec; | - |
492 | int result_len; | - |
493 | | - |
494 | mbstate_t ps; | - |
495 | | - |
496 | memset (&ps, 0, sizeof (mbstate_t)); | - |
497 | | - |
498 | | - |
499 | result = (char *)xmalloc (result_len = 128); | - |
500 | | - |
501 | i = start; | - |
502 | | - |
503 | | - |
504 | | - |
505 | | - |
506 | if (((TRUE | evaluated 135 times by 1 test | FALSE | never evaluated |
TRUE | evaluated 5 times by 1 test | FALSE | evaluated 130 times by 1 test |
TRUE | evaluated 135 times by 1 test | FALSE | never evaluated |
string[i + 1])TRUE | evaluated 5 times by 1 test | FALSE | evaluated 130 times by 1 test |
TRUE | evaluated 135 times by 1 test | FALSE | never evaluated |
? ((char *)TRUE | evaluated 5 times by 1 test | FALSE | evaluated 130 times by 1 test |
| 0-135 |
507 | (__extension__ (__builtin_constant_p (TRUE | evaluated 5 times by 1 test | FALSE | evaluated 130 times by 1 test |
| 5-130 |
508 | (string[i + 1])TRUE | evaluated 5 times by 1 test | FALSE | evaluated 130 times by 1 test |
| 5-130 |
509 | ) && !__builtin_constant_p (TRUE | evaluated 5 times by 1 test | FALSE | evaluated 130 times by 1 test |
| 5-130 |
510 | (":$*%^")TRUE | evaluated 5 times by 1 test | FALSE | evaluated 130 times by 1 test |
| 5-130 |
511 | ) && (TRUE | evaluated 5 times by 1 test | FALSE | evaluated 130 times by 1 test |
| 5-130 |
512 | (string[i + 1])TRUE | evaluated 5 times by 1 test | FALSE | evaluated 130 times by 1 test |
| 5-130 |
513 | ) == '\0' ? (char *) __rawmemchr (TRUE | evaluated 5 times by 1 test | FALSE | evaluated 130 times by 1 test |
| 5-130 |
514 | (":$*%^")TRUE | evaluated 5 times by 1 test | FALSE | evaluated 130 times by 1 test |
| 5-130 |
515 | , TRUE | evaluated 5 times by 1 test | FALSE | evaluated 130 times by 1 test |
| 5-130 |
516 | (string[i + 1])TRUE | evaluated 5 times by 1 test | FALSE | evaluated 130 times by 1 test |
| 5-130 |
517 | ) : __builtin_strchr (TRUE | evaluated 5 times by 1 test | FALSE | evaluated 130 times by 1 test |
| 5-130 |
518 | (":$*%^")TRUE | evaluated 5 times by 1 test | FALSE | evaluated 130 times by 1 test |
| 5-130 |
519 | , TRUE | evaluated 5 times by 1 test | FALSE | evaluated 130 times by 1 test |
| 5-130 |
520 | (string[i + 1])TRUE | evaluated 5 times by 1 test | FALSE | evaluated 130 times by 1 test |
| 5-130 |
521 | ))) TRUE | evaluated 5 times by 1 test | FALSE | evaluated 130 times by 1 test |
| 5-130 |
522 | != (char *)TRUE | evaluated 5 times by 1 test | FALSE | evaluated 130 times by 1 test |
| 5-130 |
523 | ((void *)0)TRUE | evaluated 5 times by 1 test | FALSE | evaluated 130 times by 1 test |
| 5-130 |
524 | ) : 0)TRUE | evaluated 5 times by 1 test | FALSE | evaluated 130 times by 1 test |
) | 5-130 |
525 | { | - |
526 | char fake_s[3]; | - |
527 | int fake_i = 0; | - |
528 | i++; | - |
529 | fake_s[0] = fake_s[1] = history_expansion_char; | - |
530 | fake_s[2] = '\0'; | - |
531 | event = get_history_event (fake_s, &fake_i, 0); | - |
532 | }executed 5 times by 1 test: end of block | 5 |
533 | else if (string[i + 1] == '#'TRUE | never evaluated | FALSE | evaluated 130 times by 1 test |
) | 0-130 |
534 | { | - |
535 | i += 2; | - |
536 | event = current_line; | - |
537 | } never executed: end of block | 0 |
538 | else | - |
539 | event = get_history_event (string, &i, qc);executed 130 times by 1 test: event = get_history_event (string, &i, qc); | 130 |
540 | | - |
541 | if (event == 0TRUE | evaluated 1 time by 1 test | FALSE | evaluated 134 times by 1 test |
) | 1-134 |
542 | { | - |
543 | *ret_string = hist_error (string, start, i, 0); | - |
544 | xfree (result); | - |
545 | returnexecuted 1 time by 1 test: return (-1); (-1);executed 1 time by 1 test: return (-1); | 1 |
546 | } | - |
547 | | - |
548 | | - |
549 | starting_index = i; | - |
550 | word_spec = get_history_word_specifier (string, event, &i); | - |
551 | | - |
552 | | - |
553 | | - |
554 | | - |
555 | if (word_spec == (char *)&error_pointerTRUE | never evaluated | FALSE | evaluated 134 times by 1 test |
) | 0-134 |
556 | { | - |
557 | *ret_string = hist_error (string, starting_index, i, 1); | - |
558 | xfree (result); | - |
559 | return never executed: return (-1); (-1);never executed: return (-1); | 0 |
560 | } | - |
561 | | - |
562 | | - |
563 | temp = word_specTRUE | evaluated 28 times by 1 test | FALSE | evaluated 106 times by 1 test |
? strcpy (xmalloc (1 + strlen (word_spec)), (word_spec)) : strcpy (xmalloc (1 + strlen (event)), (event)); | 28-106 |
564 | if (word_specTRUE | evaluated 28 times by 1 test | FALSE | evaluated 106 times by 1 test |
) free (word_spec);executed 28 times by 1 test: free (word_spec); | 28-106 |
565 | | - |
566 | | - |
567 | want_quotes = substitute_globally = subst_bywords = print_only = 0; | - |
568 | starting_index = i; | - |
569 | | - |
570 | while (string[i] == ':'TRUE | evaluated 25 times by 1 test | FALSE | evaluated 133 times by 1 test |
) | 25-133 |
571 | { | - |
572 | c = string[i + 1]; | - |
573 | | - |
574 | if (c == 'g'TRUE | evaluated 4 times by 1 test | FALSE | evaluated 21 times by 1 test |
|| c == 'a'TRUE | never evaluated | FALSE | evaluated 21 times by 1 test |
) | 0-21 |
575 | { | - |
576 | substitute_globally = 1; | - |
577 | i++; | - |
578 | c = string[i + 1]; | - |
579 | }executed 4 times by 1 test: end of block | 4 |
580 | else if (c == 'G'TRUE | never evaluated | FALSE | evaluated 21 times by 1 test |
) | 0-21 |
581 | { | - |
582 | subst_bywords = 1; | - |
583 | i++; | - |
584 | c = string[i + 1]; | - |
585 | } never executed: end of block | 0 |
586 | | - |
587 | switch (c) | - |
588 | { | - |
589 | defaultexecuted 1 time by 1 test: default: :executed 1 time by 1 test: default: | 1 |
590 | *ret_string = hist_error (string, i+1, i+2, 3); | - |
591 | xfree (result); | - |
592 | xfree (temp); | - |
593 | returnexecuted 1 time by 1 test: return -1; -1;executed 1 time by 1 test: return -1; | 1 |
594 | | - |
595 | caseexecuted 5 times by 1 test: case 'q': 'q':executed 5 times by 1 test: case 'q': | 5 |
596 | want_quotes = 'q'; | - |
597 | break;executed 5 times by 1 test: break; | 5 |
598 | | - |
599 | caseexecuted 1 time by 1 test: case 'x': 'x':executed 1 time by 1 test: case 'x': | 1 |
600 | want_quotes = 'x'; | - |
601 | break;executed 1 time by 1 test: break; | 1 |
602 | | - |
603 | | - |
604 | | - |
605 | | - |
606 | caseexecuted 3 times by 1 test: case 'p': 'p':executed 3 times by 1 test: case 'p': | 3 |
607 | print_only++; | - |
608 | break;executed 3 times by 1 test: break; | 3 |
609 | | - |
610 | | - |
611 | caseexecuted 1 time by 1 test: case 't': 't':executed 1 time by 1 test: case 't': | 1 |
612 | tstr = strrchr (temp, '/'); | - |
613 | if (tstrTRUE | evaluated 1 time by 1 test | FALSE | never evaluated |
) | 0-1 |
614 | { | - |
615 | tstr++; | - |
616 | t = strcpy (xmalloc (1 + strlen (tstr)), (tstr)); | - |
617 | xfree (temp); | - |
618 | temp = t; | - |
619 | }executed 1 time by 1 test: end of block | 1 |
620 | break;executed 1 time by 1 test: break; | 1 |
621 | | - |
622 | | - |
623 | caseexecuted 1 time by 1 test: case 'h': 'h':executed 1 time by 1 test: case 'h': | 1 |
624 | tstr = strrchr (temp, '/'); | - |
625 | if (tstrTRUE | evaluated 1 time by 1 test | FALSE | never evaluated |
) | 0-1 |
626 | *executed 1 time by 1 test: *tstr = '\0'; tstr = '\0';executed 1 time by 1 test: *tstr = '\0'; | 1 |
627 | break;executed 1 time by 1 test: break; | 1 |
628 | | - |
629 | | - |
630 | caseexecuted 5 times by 1 test: case 'r': 'r':executed 5 times by 1 test: case 'r': | 5 |
631 | tstr = strrchr (temp, '.'); | - |
632 | if (tstrTRUE | evaluated 5 times by 1 test | FALSE | never evaluated |
) | 0-5 |
633 | *executed 5 times by 1 test: *tstr = '\0'; tstr = '\0';executed 5 times by 1 test: *tstr = '\0'; | 5 |
634 | break;executed 5 times by 1 test: break; | 5 |
635 | | - |
636 | | - |
637 | caseexecuted 2 times by 1 test: case 'e': 'e':executed 2 times by 1 test: case 'e': | 2 |
638 | tstr = strrchr (temp, '.'); | - |
639 | if (tstrTRUE | evaluated 2 times by 1 test | FALSE | never evaluated |
) | 0-2 |
640 | { | - |
641 | t = strcpy (xmalloc (1 + strlen (tstr)), (tstr)); | - |
642 | xfree (temp); | - |
643 | temp = t; | - |
644 | }executed 2 times by 1 test: end of block | 2 |
645 | break;executed 2 times by 1 test: break; | 2 |
646 | | - |
647 | | - |
648 | | - |
649 | | - |
650 | | - |
651 | | - |
652 | | - |
653 | caseexecuted 1 time by 1 test: case '&': '&':executed 1 time by 1 test: case '&': | 1 |
654 | caseexecuted 5 times by 1 test: case 's': 's':executed 5 times by 1 test: case 's': | 5 |
655 | { | - |
656 | char *new_event; | - |
657 | int delimiter, failed, si, l_temp, ws, we; | - |
658 | | - |
659 | if (c == 's'TRUE | evaluated 5 times by 1 test | FALSE | evaluated 1 time by 1 test |
) | 1-5 |
660 | { | - |
661 | if (i + 2 < (int)strlen (string)TRUE | evaluated 5 times by 1 test | FALSE | never evaluated |
) | 0-5 |
662 | { | - |
663 | | - |
664 | if ( | - |
665 | (TRUE | never evaluated | FALSE | evaluated 5 times by 1 test |
__ctype_get_mb_cur_max ()) TRUE | never evaluated | FALSE | evaluated 5 times by 1 test |
| 0-5 |
666 | > 1TRUE | never evaluated | FALSE | evaluated 5 times by 1 test |
&& rl_byte_oriented == 0TRUE | never evaluated | FALSE | never evaluated |
) | 0-5 |
667 | { | - |
668 | _rl_adjust_point (string, i + 2, &ps); | - |
669 | if (_rl_get_char_len (string + i + 2, &ps) > 1TRUE | never evaluated | FALSE | never evaluated |
) | 0 |
670 | delimiter = 0; never executed: delimiter = 0; | 0 |
671 | else | - |
672 | delimiter = string[i + 2]; never executed: delimiter = string[i + 2]; | 0 |
673 | } | - |
674 | else | - |
675 | | - |
676 | delimiter = string[i + 2];executed 5 times by 1 test: delimiter = string[i + 2]; | 5 |
677 | } | - |
678 | else | - |
679 | break; never executed: break; | 0 |
680 | | - |
681 | i += 3; | - |
682 | | - |
683 | t = get_subst_pattern (string, &i, delimiter, 0, &subst_lhs_len); | - |
684 | | - |
685 | | - |
686 | if (tTRUE | evaluated 5 times by 1 test | FALSE | never evaluated |
) | 0-5 |
687 | { | - |
688 | if (subst_lhsTRUE | evaluated 4 times by 1 test | FALSE | evaluated 1 time by 1 test |
) free (subst_lhs);executed 4 times by 1 test: free (subst_lhs); | 1-4 |
689 | subst_lhs = t; | - |
690 | }executed 5 times by 1 test: end of block | 5 |
691 | else if (!subst_lhsTRUE | never evaluated | FALSE | never evaluated |
) | 0 |
692 | { | - |
693 | if (search_stringTRUE | never evaluated | FALSE | never evaluated |
&& *TRUE | never evaluated | FALSE | never evaluated |
search_stringTRUE | never evaluated | FALSE | never evaluated |
) | 0 |
694 | { | - |
695 | subst_lhs = strcpy (xmalloc (1 + strlen (search_string)), (search_string)); | - |
696 | subst_lhs_len = strlen (subst_lhs); | - |
697 | } never executed: end of block | 0 |
698 | else | - |
699 | { | - |
700 | subst_lhs = (char *) | - |
701 | ((void *)0) | - |
702 | ; | - |
703 | subst_lhs_len = 0; | - |
704 | } never executed: end of block | 0 |
705 | } | - |
706 | | - |
707 | if (subst_rhsTRUE | evaluated 4 times by 1 test | FALSE | evaluated 1 time by 1 test |
) free (subst_rhs);executed 4 times by 1 test: free (subst_rhs); | 1-4 |
708 | subst_rhs = get_subst_pattern (string, &i, delimiter, 1, &subst_rhs_len); | - |
709 | | - |
710 | | - |
711 | | - |
712 | if (((TRUE | evaluated 5 times by 1 test | FALSE | never evaluated |
TRUE | evaluated 1 time by 1 test | FALSE | evaluated 4 times by 1 test |
TRUE | evaluated 5 times by 1 test | FALSE | never evaluated |
'&')TRUE | evaluated 1 time by 1 test | FALSE | evaluated 4 times by 1 test |
TRUE | evaluated 5 times by 1 test | FALSE | never evaluated |
? ((char *)TRUE | evaluated 1 time by 1 test | FALSE | evaluated 4 times by 1 test |
| 0-5 |
713 | (__extension__ (__builtin_constant_p (TRUE | evaluated 1 time by 1 test | FALSE | evaluated 4 times by 1 test |
| 1-4 |
714 | ('&')TRUE | evaluated 1 time by 1 test | FALSE | evaluated 4 times by 1 test |
| 1-4 |
715 | ) && !__builtin_constant_p (TRUE | evaluated 1 time by 1 test | FALSE | evaluated 4 times by 1 test |
| 1-4 |
716 | (subst_rhs)TRUE | evaluated 1 time by 1 test | FALSE | evaluated 4 times by 1 test |
| 1-4 |
717 | ) && (TRUE | evaluated 1 time by 1 test | FALSE | evaluated 4 times by 1 test |
| 1-4 |
718 | ('&')TRUE | evaluated 1 time by 1 test | FALSE | evaluated 4 times by 1 test |
| 1-4 |
719 | ) == '\0' ? (char *) __rawmemchr (TRUE | evaluated 1 time by 1 test | FALSE | evaluated 4 times by 1 test |
| 1-4 |
720 | (subst_rhs)TRUE | evaluated 1 time by 1 test | FALSE | evaluated 4 times by 1 test |
| 1-4 |
721 | , TRUE | evaluated 1 time by 1 test | FALSE | evaluated 4 times by 1 test |
| 1-4 |
722 | ('&')TRUE | evaluated 1 time by 1 test | FALSE | evaluated 4 times by 1 test |
| 1-4 |
723 | ) : __builtin_strchr (TRUE | evaluated 1 time by 1 test | FALSE | evaluated 4 times by 1 test |
| 1-4 |
724 | (subst_rhs)TRUE | evaluated 1 time by 1 test | FALSE | evaluated 4 times by 1 test |
| 1-4 |
725 | , TRUE | evaluated 1 time by 1 test | FALSE | evaluated 4 times by 1 test |
| 1-4 |
726 | ('&')TRUE | evaluated 1 time by 1 test | FALSE | evaluated 4 times by 1 test |
| 1-4 |
727 | ))) TRUE | evaluated 1 time by 1 test | FALSE | evaluated 4 times by 1 test |
| 1-4 |
728 | != (char *)TRUE | evaluated 1 time by 1 test | FALSE | evaluated 4 times by 1 test |
| 1-4 |
729 | ((void *)0)TRUE | evaluated 1 time by 1 test | FALSE | evaluated 4 times by 1 test |
| 1-4 |
730 | ) : 0)TRUE | evaluated 1 time by 1 test | FALSE | evaluated 4 times by 1 test |
) | 1-4 |
731 | postproc_subst_rhs ();executed 1 time by 1 test: postproc_subst_rhs (); | 1 |
732 | }executed 5 times by 1 test: end of block | 5 |
733 | else | - |
734 | i += 2;executed 1 time by 1 test: i += 2; | 1 |
735 | | - |
736 | | - |
737 | if (subst_lhs_len == 0TRUE | never evaluated | FALSE | evaluated 6 times by 1 test |
) | 0-6 |
738 | { | - |
739 | *ret_string = hist_error (string, starting_index, i, 4); | - |
740 | xfree (result); | - |
741 | xfree (temp); | - |
742 | return never executed: return -1; -1;never executed: return -1; | 0 |
743 | } | - |
744 | | - |
745 | l_temp = strlen (temp); | - |
746 | | - |
747 | if (subst_lhs_len > l_tempTRUE | never evaluated | FALSE | evaluated 6 times by 1 test |
) | 0-6 |
748 | { | - |
749 | *ret_string = hist_error (string, starting_index, i, 2); | - |
750 | xfree (result); | - |
751 | xfree (temp); | - |
752 | return never executed: return (-1); (-1);never executed: return (-1); | 0 |
753 | } | - |
754 | si = we = 0; | - |
755 | for (failed = 1; (TRUE | evaluated 105 times by 1 test | FALSE | evaluated 4 times by 1 test |
si + subst_lhs_len) <= l_tempTRUE | evaluated 105 times by 1 test | FALSE | evaluated 4 times by 1 test |
; si++) | 4-105 |
756 | { | - |
757 | | - |
758 | | - |
759 | | - |
760 | if (subst_bywordsTRUE | never evaluated | FALSE | evaluated 105 times by 1 test |
&& si > weTRUE | never evaluated | FALSE | never evaluated |
) | 0-105 |
761 | { | - |
762 | for (; temp[si]TRUE | never evaluated | FALSE | never evaluated |
&& (((TRUE | never evaluated | FALSE | never evaluated |
temp[si]) == ' ')TRUE | never evaluated | FALSE | never evaluated |
|| ((TRUE | never evaluated | FALSE | never evaluated |
temp[si]) == '\t')TRUE | never evaluated | FALSE | never evaluated |
); si++) | 0 |
763 | ; never executed: ; | 0 |
764 | ws = si; | - |
765 | we = history_tokenize_word (temp, si); | - |
766 | } never executed: end of block | 0 |
767 | | - |
768 | if ((((TRUE | never evaluated | FALSE | evaluated 105 times by 1 test |
TRUE | evaluated 18 times by 1 test | FALSE | evaluated 87 times by 1 test |
TRUE | never evaluated | FALSE | evaluated 105 times by 1 test |
subst_lhs_len) == 0)TRUE | evaluated 18 times by 1 test | FALSE | evaluated 87 times by 1 test |
TRUE | never evaluated | FALSE | evaluated 105 times by 1 test |
? (1) : ((TRUE | evaluated 18 times by 1 test | FALSE | evaluated 87 times by 1 test |
temp+si)[0] == (subst_lhs)[0])TRUE | evaluated 18 times by 1 test | FALSE | evaluated 87 times by 1 test |
&& (TRUE | evaluated 18 times by 1 test | FALSE | never evaluated |
TRUE | evaluated 18 times by 1 test | FALSE | evaluated 87 times by 1 test |
| 0-105 |
769 | (__extension__ (__builtin_constant_p (TRUE | never evaluated | FALSE | evaluated 18 times by 1 test |
TRUE | evaluated 18 times by 1 test | FALSE | never evaluated |
TRUE | evaluated 18 times by 1 test | FALSE | evaluated 87 times by 1 test |
| 0-87 |
770 | (subst_lhs_len)TRUE | never evaluated | FALSE | evaluated 18 times by 1 test |
TRUE | evaluated 18 times by 1 test | FALSE | never evaluated |
TRUE | evaluated 18 times by 1 test | FALSE | evaluated 87 times by 1 test |
| 0-87 |
771 | )TRUE | never evaluated | FALSE | evaluated 18 times by 1 test |
&& ((__builtin_constant_p (TRUE | never evaluated | FALSE | never evaluated |
TRUE | evaluated 18 times by 1 test | FALSE | never evaluated |
TRUE | evaluated 18 times by 1 test | FALSE | evaluated 87 times by 1 test |
| 0-87 |
772 | (temp+si)TRUE | never evaluated | FALSE | never evaluated |
TRUE | evaluated 18 times by 1 test | FALSE | never evaluated |
TRUE | evaluated 18 times by 1 test | FALSE | evaluated 87 times by 1 test |
| 0-87 |
773 | )TRUE | never evaluated | FALSE | never evaluated |
&& strlen (TRUE | never evaluated | FALSE | never evaluated |
TRUE | evaluated 18 times by 1 test | FALSE | never evaluated |
TRUE | evaluated 18 times by 1 test | FALSE | evaluated 87 times by 1 test |
| 0-87 |
774 | (temp+si)TRUE | never evaluated | FALSE | never evaluated |
TRUE | evaluated 18 times by 1 test | FALSE | never evaluated |
TRUE | evaluated 18 times by 1 test | FALSE | evaluated 87 times by 1 test |
| 0-87 |
775 | ) < ((size_t) (TRUE | never evaluated | FALSE | never evaluated |
TRUE | evaluated 18 times by 1 test | FALSE | never evaluated |
TRUE | evaluated 18 times by 1 test | FALSE | evaluated 87 times by 1 test |
| 0-87 |
776 | (subst_lhs_len)TRUE | never evaluated | FALSE | never evaluated |
TRUE | evaluated 18 times by 1 test | FALSE | never evaluated |
TRUE | evaluated 18 times by 1 test | FALSE | evaluated 87 times by 1 test |
| 0-87 |
777 | ))TRUE | never evaluated | FALSE | never evaluated |
) || (__builtin_constant_p (TRUE | never evaluated | FALSE | never evaluated |
TRUE | evaluated 18 times by 1 test | FALSE | never evaluated |
TRUE | evaluated 18 times by 1 test | FALSE | evaluated 87 times by 1 test |
| 0-87 |
778 | (subst_lhs)TRUE | never evaluated | FALSE | never evaluated |
TRUE | evaluated 18 times by 1 test | FALSE | never evaluated |
TRUE | evaluated 18 times by 1 test | FALSE | evaluated 87 times by 1 test |
| 0-87 |
779 | )TRUE | never evaluated | FALSE | never evaluated |
&& strlen (TRUE | never evaluated | FALSE | never evaluated |
TRUE | evaluated 18 times by 1 test | FALSE | never evaluated |
TRUE | evaluated 18 times by 1 test | FALSE | evaluated 87 times by 1 test |
| 0-87 |
780 | (subst_lhs)TRUE | never evaluated | FALSE | never evaluated |
TRUE | evaluated 18 times by 1 test | FALSE | never evaluated |
TRUE | evaluated 18 times by 1 test | FALSE | evaluated 87 times by 1 test |
| 0-87 |
781 | ) < ((size_t) (TRUE | never evaluated | FALSE | never evaluated |
TRUE | evaluated 18 times by 1 test | FALSE | never evaluated |
TRUE | evaluated 18 times by 1 test | FALSE | evaluated 87 times by 1 test |
| 0-87 |
782 | (subst_lhs_len)TRUE | never evaluated | FALSE | never evaluated |
TRUE | evaluated 18 times by 1 test | FALSE | never evaluated |
TRUE | evaluated 18 times by 1 test | FALSE | evaluated 87 times by 1 test |
| 0-87 |
783 | ))TRUE | never evaluated | FALSE | never evaluated |
)) ? __extension__ ({ size_t __s1_len, __s2_len; (__builtin_constant_p (TRUE | evaluated 18 times by 1 test | FALSE | never evaluated |
TRUE | evaluated 18 times by 1 test | FALSE | evaluated 87 times by 1 test |
| 0-87 |
784 | (temp+si)TRUE | evaluated 18 times by 1 test | FALSE | never evaluated |
TRUE | evaluated 18 times by 1 test | FALSE | evaluated 87 times by 1 test |
| 0-87 |
785 | ) && __builtin_constant_p (TRUE | evaluated 18 times by 1 test | FALSE | never evaluated |
TRUE | evaluated 18 times by 1 test | FALSE | evaluated 87 times by 1 test |
| 0-87 |
786 | (subst_lhs)TRUE | evaluated 18 times by 1 test | FALSE | never evaluated |
TRUE | evaluated 18 times by 1 test | FALSE | evaluated 87 times by 1 test |
| 0-87 |
787 | ) && (__s1_len = __builtin_strlen (TRUE | evaluated 18 times by 1 test | FALSE | never evaluated |
TRUE | evaluated 18 times by 1 test | FALSE | evaluated 87 times by 1 test |
| 0-87 |
788 | (temp+si)TRUE | evaluated 18 times by 1 test | FALSE | never evaluated |
TRUE | evaluated 18 times by 1 test | FALSE | evaluated 87 times by 1 test |
| 0-87 |
789 | ), __s2_len = __builtin_strlen (TRUE | evaluated 18 times by 1 test | FALSE | never evaluated |
TRUE | evaluated 18 times by 1 test | FALSE | evaluated 87 times by 1 test |
| 0-87 |
790 | (subst_lhs)TRUE | evaluated 18 times by 1 test | FALSE | never evaluated |
TRUE | evaluated 18 times by 1 test | FALSE | evaluated 87 times by 1 test |
| 0-87 |
791 | ), (!((size_t)(const void *)((TRUE | evaluated 18 times by 1 test | FALSE | never evaluated |
TRUE | evaluated 18 times by 1 test | FALSE | evaluated 87 times by 1 test |
| 0-87 |
792 | (temp+si)TRUE | evaluated 18 times by 1 test | FALSE | never evaluated |
TRUE | evaluated 18 times by 1 test | FALSE | evaluated 87 times by 1 test |
| 0-87 |
793 | ) + 1) - (size_t)(const void *)(TRUE | evaluated 18 times by 1 test | FALSE | never evaluated |
TRUE | evaluated 18 times by 1 test | FALSE | evaluated 87 times by 1 test |
| 0-87 |
794 | (temp+si)TRUE | evaluated 18 times by 1 test | FALSE | never evaluated |
TRUE | evaluated 18 times by 1 test | FALSE | evaluated 87 times by 1 test |
| 0-87 |
795 | ) == 1) || __s1_len >= 4) && (!((size_t)(const void *)((TRUE | evaluated 18 times by 1 test | FALSE | never evaluated |
TRUE | evaluated 18 times by 1 test | FALSE | evaluated 87 times by 1 test |
| 0-87 |
796 | (subst_lhs)TRUE | evaluated 18 times by 1 test | FALSE | never evaluated |
TRUE | evaluated 18 times by 1 test | FALSE | evaluated 87 times by 1 test |
| 0-87 |
797 | ) + 1) - (size_t)(const void *)(TRUE | evaluated 18 times by 1 test | FALSE | never evaluated |
TRUE | evaluated 18 times by 1 test | FALSE | evaluated 87 times by 1 test |
| 0-87 |
798 | (subst_lhs)TRUE | evaluated 18 times by 1 test | FALSE | never evaluated |
TRUE | evaluated 18 times by 1 test | FALSE | evaluated 87 times by 1 test |
| 0-87 |
799 | ) == 1) || __s2_len >= 4)) ? __builtin_strcmp (TRUE | evaluated 18 times by 1 test | FALSE | never evaluated |
TRUE | evaluated 18 times by 1 test | FALSE | evaluated 87 times by 1 test |
| 0-87 |
800 | (temp+si)TRUE | evaluated 18 times by 1 test | FALSE | never evaluated |
TRUE | evaluated 18 times by 1 test | FALSE | evaluated 87 times by 1 test |
| 0-87 |
801 | , TRUE | evaluated 18 times by 1 test | FALSE | never evaluated |
TRUE | evaluated 18 times by 1 test | FALSE | evaluated 87 times by 1 test |
| 0-87 |
802 | (subst_lhs)TRUE | evaluated 18 times by 1 test | FALSE | never evaluated |
TRUE | evaluated 18 times by 1 test | FALSE | evaluated 87 times by 1 test |
| 0-87 |
803 | ) : (__builtin_constant_p (TRUE | evaluated 18 times by 1 test | FALSE | never evaluated |
TRUE | evaluated 18 times by 1 test | FALSE | evaluated 87 times by 1 test |
| 0-87 |
804 | (temp+si)TRUE | evaluated 18 times by 1 test | FALSE | never evaluated |
TRUE | evaluated 18 times by 1 test | FALSE | evaluated 87 times by 1 test |
| 0-87 |
805 | ) && ((size_t)(const void *)((TRUE | evaluated 18 times by 1 test | FALSE | never evaluated |
TRUE | evaluated 18 times by 1 test | FALSE | evaluated 87 times by 1 test |
| 0-87 |
806 | (temp+si)TRUE | evaluated 18 times by 1 test | FALSE | never evaluated |
TRUE | evaluated 18 times by 1 test | FALSE | evaluated 87 times by 1 test |
| 0-87 |
807 | ) + 1) - (size_t)(const void *)(TRUE | evaluated 18 times by 1 test | FALSE | never evaluated |
TRUE | evaluated 18 times by 1 test | FALSE | evaluated 87 times by 1 test |
| 0-87 |
808 | (temp+si)TRUE | evaluated 18 times by 1 test | FALSE | never evaluated |
TRUE | evaluated 18 times by 1 test | FALSE | evaluated 87 times by 1 test |
| 0-87 |
809 | ) == 1) && (__s1_len = __builtin_strlen (TRUE | evaluated 18 times by 1 test | FALSE | never evaluated |
TRUE | evaluated 18 times by 1 test | FALSE | evaluated 87 times by 1 test |
| 0-87 |
810 | (temp+si)TRUE | evaluated 18 times by 1 test | FALSE | never evaluated |
TRUE | evaluated 18 times by 1 test | FALSE | evaluated 87 times by 1 test |
| 0-87 |
811 | ), __s1_len < 4) ? (__builtin_constant_p (TRUE | evaluated 18 times by 1 test | FALSE | never evaluated |
TRUE | evaluated 18 times by 1 test | FALSE | evaluated 87 times by 1 test |
| 0-87 |
812 | (subst_lhs)TRUE | evaluated 18 times by 1 test | FALSE | never evaluated |
TRUE | evaluated 18 times by 1 test | FALSE | evaluated 87 times by 1 test |
| 0-87 |
813 | ) && ((size_t)(const void *)((TRUE | evaluated 18 times by 1 test | FALSE | never evaluated |
TRUE | evaluated 18 times by 1 test | FALSE | evaluated 87 times by 1 test |
| 0-87 |
814 | (subst_lhs)TRUE | evaluated 18 times by 1 test | FALSE | never evaluated |
TRUE | evaluated 18 times by 1 test | FALSE | evaluated 87 times by 1 test |
| 0-87 |
815 | ) + 1) - (size_t)(const void *)(TRUE | evaluated 18 times by 1 test | FALSE | never evaluated |
TRUE | evaluated 18 times by 1 test | FALSE | evaluated 87 times by 1 test |
| 0-87 |
816 | (subst_lhs)TRUE | evaluated 18 times by 1 test | FALSE | never evaluated |
TRUE | evaluated 18 times by 1 test | FALSE | evaluated 87 times by 1 test |
| 0-87 |
817 | ) == 1) ? __builtin_strcmp (TRUE | evaluated 18 times by 1 test | FALSE | never evaluated |
TRUE | evaluated 18 times by 1 test | FALSE | evaluated 87 times by 1 test |
| 0-87 |
818 | (temp+si)TRUE | evaluated 18 times by 1 test | FALSE | never evaluated |
TRUE | evaluated 18 times by 1 test | FALSE | evaluated 87 times by 1 test |
| 0-87 |
819 | , TRUE | evaluated 18 times by 1 test | FALSE | never evaluated |
TRUE | evaluated 18 times by 1 test | FALSE | evaluated 87 times by 1 test |
| 0-87 |
820 | (subst_lhs)TRUE | evaluated 18 times by 1 test | FALSE | never evaluated |
TRUE | evaluated 18 times by 1 test | FALSE | evaluated 87 times by 1 test |
| 0-87 |
821 | ) : (__extension__ ({ const unsigned char *__s2 = (const unsigned char *) (const char *) (TRUE | evaluated 18 times by 1 test | FALSE | never evaluated |
TRUE | evaluated 18 times by 1 test | FALSE | evaluated 87 times by 1 test |
| 0-87 |
822 | (subst_lhs)TRUE | evaluated 18 times by 1 test | FALSE | never evaluated |
TRUE | evaluated 18 times by 1 test | FALSE | evaluated 87 times by 1 test |
| 0-87 |
823 | ); int __result = (((const unsigned char *) (const char *) (TRUE | evaluated 18 times by 1 test | FALSE | never evaluated |
TRUE | evaluated 18 times by 1 test | FALSE | evaluated 87 times by 1 test |
| 0-87 |
824 | (temp+si)TRUE | evaluated 18 times by 1 test | FALSE | never evaluated |
TRUE | evaluated 18 times by 1 test | FALSE | evaluated 87 times by 1 test |
| 0-87 |
825 | ))[0] - __s2[0]); if (__s1_len > 0TRUE | never evaluated | FALSE | never evaluated |
&& __result == 0TRUE | never evaluated | FALSE | never evaluated |
) { __result = (((const unsigned char *) (const char *) (TRUE | evaluated 18 times by 1 test | FALSE | never evaluated |
TRUE | evaluated 18 times by 1 test | FALSE | evaluated 87 times by 1 test |
| 0-87 |
826 | (temp+si)TRUE | evaluated 18 times by 1 test | FALSE | never evaluated |
TRUE | evaluated 18 times by 1 test | FALSE | evaluated 87 times by 1 test |
| 0-87 |
827 | ))[1] - __s2[1]); if (__s1_len > 1TRUE | never evaluated | FALSE | never evaluated |
&& __result == 0TRUE | never evaluated | FALSE | never evaluated |
) { __result = (((const unsigned char *) (const char *) (TRUE | evaluated 18 times by 1 test | FALSE | never evaluated |
TRUE | evaluated 18 times by 1 test | FALSE | evaluated 87 times by 1 test |
| 0-87 |
828 | (temp+si)TRUE | evaluated 18 times by 1 test | FALSE | never evaluated |
TRUE | evaluated 18 times by 1 test | FALSE | evaluated 87 times by 1 test |
| 0-87 |
829 | ))[2] - __s2[2]); if (__s1_len > 2TRUE | never evaluated | FALSE | never evaluated |
&& __result == 0TRUE | never evaluated | FALSE | never evaluated |
) __result = (((const unsigned char *) (const char *) (never executed: __result = (((const unsigned char *) (const char *) ( (temp+si) ))[3] - __s2[3]); TRUE | evaluated 18 times by 1 test | FALSE | never evaluated |
TRUE | evaluated 18 times by 1 test | FALSE | evaluated 87 times by 1 test |
| 0-87 |
830 | (temp+si)TRUE | evaluated 18 times by 1 test | FALSE | never evaluated |
TRUE | evaluated 18 times by 1 test | FALSE | evaluated 87 times by 1 test |
never executed: __result = (((const unsigned char *) (const char *) ( (temp+si) ))[3] - __s2[3]); | 0-87 |
831 | ))[3] - __s2[3]);TRUE | evaluated 18 times by 1 test | FALSE | never evaluated |
TRUE | evaluated 18 times by 1 test | FALSE | evaluated 87 times by 1 test |
TRUE | evaluated 18 times by 1 test | FALSE | never evaluated |
never executed: __result = (((const unsigned char *) (const char *) ( (temp+si) ))[3] - __s2[3]); }never executed: end of block }never executed: end of block __result; }))) : (__builtin_constant_p (TRUE | evaluated 18 times by 1 test | FALSE | evaluated 87 times by 1 test |
TRUE | evaluated 18 times by 1 test | FALSE | never evaluated |
| 0-87 |
832 | (subst_lhs)TRUE | evaluated 18 times by 1 test | FALSE | never evaluated |
TRUE | evaluated 18 times by 1 test | FALSE | evaluated 87 times by 1 test |
| 0-87 |
833 | ) && ((size_t)(const void *)((TRUE | evaluated 18 times by 1 test | FALSE | never evaluated |
TRUE | evaluated 18 times by 1 test | FALSE | evaluated 87 times by 1 test |
| 0-87 |
834 | (subst_lhs)TRUE | evaluated 18 times by 1 test | FALSE | never evaluated |
TRUE | evaluated 18 times by 1 test | FALSE | evaluated 87 times by 1 test |
| 0-87 |
835 | ) + 1) - (size_t)(const void *)(TRUE | evaluated 18 times by 1 test | FALSE | never evaluated |
TRUE | evaluated 18 times by 1 test | FALSE | evaluated 87 times by 1 test |
| 0-87 |
836 | (subst_lhs)TRUE | evaluated 18 times by 1 test | FALSE | never evaluated |
TRUE | evaluated 18 times by 1 test | FALSE | evaluated 87 times by 1 test |
| 0-87 |
837 | ) == 1) && (__s2_len = __builtin_strlen (TRUE | evaluated 18 times by 1 test | FALSE | never evaluated |
TRUE | evaluated 18 times by 1 test | FALSE | evaluated 87 times by 1 test |
| 0-87 |
838 | (subst_lhs)TRUE | evaluated 18 times by 1 test | FALSE | never evaluated |
TRUE | evaluated 18 times by 1 test | FALSE | evaluated 87 times by 1 test |
| 0-87 |
839 | ), __s2_len < 4) ? (__builtin_constant_p (TRUE | evaluated 18 times by 1 test | FALSE | never evaluated |
TRUE | evaluated 18 times by 1 test | FALSE | evaluated 87 times by 1 test |
| 0-87 |
840 | (temp+si)TRUE | evaluated 18 times by 1 test | FALSE | never evaluated |
TRUE | evaluated 18 times by 1 test | FALSE | evaluated 87 times by 1 test |
| 0-87 |
841 | ) && ((size_t)(const void *)((TRUE | evaluated 18 times by 1 test | FALSE | never evaluated |
TRUE | evaluated 18 times by 1 test | FALSE | evaluated 87 times by 1 test |
| 0-87 |
842 | (temp+si)TRUE | evaluated 18 times by 1 test | FALSE | never evaluated |
TRUE | evaluated 18 times by 1 test | FALSE | evaluated 87 times by 1 test |
| 0-87 |
843 | ) + 1) - (size_t)(const void *)(TRUE | evaluated 18 times by 1 test | FALSE | never evaluated |
TRUE | evaluated 18 times by 1 test | FALSE | evaluated 87 times by 1 test |
| 0-87 |
844 | (temp+si)TRUE | evaluated 18 times by 1 test | FALSE | never evaluated |
TRUE | evaluated 18 times by 1 test | FALSE | evaluated 87 times by 1 test |
| 0-87 |
845 | ) == 1) ? __builtin_strcmp (TRUE | evaluated 18 times by 1 test | FALSE | never evaluated |
TRUE | evaluated 18 times by 1 test | FALSE | evaluated 87 times by 1 test |
| 0-87 |
846 | (temp+si)TRUE | evaluated 18 times by 1 test | FALSE | never evaluated |
TRUE | evaluated 18 times by 1 test | FALSE | evaluated 87 times by 1 test |
| 0-87 |
847 | , TRUE | evaluated 18 times by 1 test | FALSE | never evaluated |
TRUE | evaluated 18 times by 1 test | FALSE | evaluated 87 times by 1 test |
| 0-87 |
848 | (subst_lhs)TRUE | evaluated 18 times by 1 test | FALSE | never evaluated |
TRUE | evaluated 18 times by 1 test | FALSE | evaluated 87 times by 1 test |
| 0-87 |
849 | ) : -(__extension__ ({ const unsigned char *__s2 = (const unsigned char *) (const char *) (TRUE | evaluated 18 times by 1 test | FALSE | never evaluated |
TRUE | evaluated 18 times by 1 test | FALSE | evaluated 87 times by 1 test |
| 0-87 |
850 | (temp+si)TRUE | evaluated 18 times by 1 test | FALSE | never evaluated |
TRUE | evaluated 18 times by 1 test | FALSE | evaluated 87 times by 1 test |
| 0-87 |
851 | ); int __result = (((const unsigned char *) (const char *) (TRUE | evaluated 18 times by 1 test | FALSE | never evaluated |
TRUE | evaluated 18 times by 1 test | FALSE | evaluated 87 times by 1 test |
| 0-87 |
852 | (subst_lhs)TRUE | evaluated 18 times by 1 test | FALSE | never evaluated |
TRUE | evaluated 18 times by 1 test | FALSE | evaluated 87 times by 1 test |
| 0-87 |
853 | ))[0] - __s2[0]); if (__s2_len > 0TRUE | never evaluated | FALSE | never evaluated |
&& __result == 0TRUE | never evaluated | FALSE | never evaluated |
) { __result = (((const unsigned char *) (const char *) (TRUE | evaluated 18 times by 1 test | FALSE | never evaluated |
TRUE | evaluated 18 times by 1 test | FALSE | evaluated 87 times by 1 test |
| 0-87 |
854 | (subst_lhs)TRUE | evaluated 18 times by 1 test | FALSE | never evaluated |
TRUE | evaluated 18 times by 1 test | FALSE | evaluated 87 times by 1 test |
| 0-87 |
855 | ))[1] - __s2[1]); if (__s2_len > 1TRUE | never evaluated | FALSE | never evaluated |
&& __result == 0TRUE | never evaluated | FALSE | never evaluated |
) { __result = (((const unsigned char *) (const char *) (TRUE | evaluated 18 times by 1 test | FALSE | never evaluated |
TRUE | evaluated 18 times by 1 test | FALSE | evaluated 87 times by 1 test |
| 0-87 |
856 | (subst_lhs)TRUE | evaluated 18 times by 1 test | FALSE | never evaluated |
TRUE | evaluated 18 times by 1 test | FALSE | evaluated 87 times by 1 test |
| 0-87 |
857 | ))[2] - __s2[2]); if (__s2_len > 2TRUE | never evaluated | FALSE | never evaluated |
&& __result == 0TRUE | never evaluated | FALSE | never evaluated |
) __result = (((const unsigned char *) (const char *) (never executed: __result = (((const unsigned char *) (const char *) ( (subst_lhs) ))[3] - __s2[3]); TRUE | evaluated 18 times by 1 test | FALSE | never evaluated |
TRUE | evaluated 18 times by 1 test | FALSE | evaluated 87 times by 1 test |
| 0-87 |
858 | (subst_lhs)TRUE | evaluated 18 times by 1 test | FALSE | never evaluated |
TRUE | evaluated 18 times by 1 test | FALSE | evaluated 87 times by 1 test |
never executed: __result = (((const unsigned char *) (const char *) ( (subst_lhs) ))[3] - __s2[3]); | 0-87 |
859 | ))[3] - __s2[3]);TRUE | evaluated 18 times by 1 test | FALSE | never evaluated |
TRUE | evaluated 18 times by 1 test | FALSE | evaluated 87 times by 1 test |
TRUE | evaluated 18 times by 1 test | FALSE | never evaluated |
never executed: __result = (((const unsigned char *) (const char *) ( (subst_lhs) ))[3] - __s2[3]); }never executed: end of block }never executed: end of block __result; }))) : __builtin_strcmp (TRUE | evaluated 18 times by 1 test | FALSE | evaluated 87 times by 1 test |
TRUE | evaluated 18 times by 1 test | FALSE | never evaluated |
| 0-87 |
860 | (temp+si)TRUE | evaluated 18 times by 1 test | FALSE | never evaluated |
TRUE | evaluated 18 times by 1 test | FALSE | evaluated 87 times by 1 test |
| 0-87 |
861 | , TRUE | evaluated 18 times by 1 test | FALSE | never evaluated |
TRUE | evaluated 18 times by 1 test | FALSE | evaluated 87 times by 1 test |
| 0-87 |
862 | (subst_lhs)TRUE | evaluated 18 times by 1 test | FALSE | never evaluated |
TRUE | evaluated 18 times by 1 test | FALSE | evaluated 87 times by 1 test |
| 0-87 |
863 | )))); }) : strncmp (TRUE | evaluated 18 times by 1 test | FALSE | never evaluated |
TRUE | evaluated 18 times by 1 test | FALSE | evaluated 87 times by 1 test |
| 0-87 |
864 | (temp+si)TRUE | evaluated 18 times by 1 test | FALSE | never evaluated |
TRUE | evaluated 18 times by 1 test | FALSE | evaluated 87 times by 1 test |
| 0-87 |
865 | , TRUE | evaluated 18 times by 1 test | FALSE | never evaluated |
TRUE | evaluated 18 times by 1 test | FALSE | evaluated 87 times by 1 test |
| 0-87 |
866 | (subst_lhs)TRUE | evaluated 18 times by 1 test | FALSE | never evaluated |
TRUE | evaluated 18 times by 1 test | FALSE | evaluated 87 times by 1 test |
| 0-87 |
867 | , TRUE | evaluated 18 times by 1 test | FALSE | never evaluated |
TRUE | evaluated 18 times by 1 test | FALSE | evaluated 87 times by 1 test |
| 0-87 |
868 | (subst_lhs_len)TRUE | evaluated 18 times by 1 test | FALSE | never evaluated |
TRUE | evaluated 18 times by 1 test | FALSE | evaluated 87 times by 1 test |
| 0-87 |
869 | ))) TRUE | evaluated 18 times by 1 test | FALSE | never evaluated |
TRUE | evaluated 18 times by 1 test | FALSE | evaluated 87 times by 1 test |
| 0-87 |
870 | == 0)TRUE | evaluated 18 times by 1 test | FALSE | never evaluated |
)TRUE | evaluated 18 times by 1 test | FALSE | evaluated 87 times by 1 test |
) | 0-87 |
871 | { | - |
872 | int len = subst_rhs_len - subst_lhs_len + l_temp; | - |
873 | new_event = (char *)xmalloc (1 + len); | - |
874 | | - |
875 | __builtin_strncpy ( | - |
876 | new_event | - |
877 | , | - |
878 | temp | - |
879 | , | - |
880 | si | - |
881 | ) | - |
882 | ; | - |
883 | | - |
884 | __builtin_strncpy ( | - |
885 | new_event + si | - |
886 | , | - |
887 | subst_rhs | - |
888 | , | - |
889 | subst_rhs_len | - |
890 | ) | - |
891 | ; | - |
892 | | - |
893 | __builtin_strncpy ( | - |
894 | new_event + si + subst_rhs_len | - |
895 | , | - |
896 | temp + si + subst_lhs_len | - |
897 | , | - |
898 | l_temp - (si + subst_lhs_len) | - |
899 | ) | - |
900 | | - |
901 | | - |
902 | ; | - |
903 | new_event[len] = '\0'; | - |
904 | xfree (temp); | - |
905 | temp = new_event; | - |
906 | | - |
907 | failed = 0; | - |
908 | | - |
909 | if (substitute_globallyTRUE | evaluated 16 times by 1 test | FALSE | evaluated 2 times by 1 test |
) | 2-16 |
910 | { | - |
911 | | - |
912 | | - |
913 | | - |
914 | si += subst_rhs_len - 1; | - |
915 | l_temp = strlen (temp); | - |
916 | substitute_globally++; | - |
917 | continue;executed 16 times by 1 test: continue; | 16 |
918 | } | - |
919 | else if (subst_bywordsTRUE | never evaluated | FALSE | evaluated 2 times by 1 test |
) | 0-2 |
920 | { | - |
921 | si = we; | - |
922 | l_temp = strlen (temp); | - |
923 | continue; never executed: continue; | 0 |
924 | } | - |
925 | else | - |
926 | break;executed 2 times by 1 test: break; | 2 |
927 | } | - |
928 | }executed 87 times by 1 test: end of block | 87 |
929 | | - |
930 | if (substitute_globally > 1TRUE | evaluated 4 times by 1 test | FALSE | evaluated 2 times by 1 test |
) | 2-4 |
931 | { | - |
932 | substitute_globally = 0; | - |
933 | continue;executed 4 times by 1 test: continue; | 4 |
934 | } | - |
935 | | - |
936 | if (failed == 0TRUE | evaluated 2 times by 1 test | FALSE | never evaluated |
) | 0-2 |
937 | continue;executed 2 times by 1 test: continue; | 2 |
938 | | - |
939 | *ret_string = hist_error (string, starting_index, i, 2); | - |
940 | xfree (result); | - |
941 | xfree (temp); | - |
942 | return never executed: return (-1); (-1);never executed: return (-1); | 0 |
943 | } | - |
944 | } | - |
945 | i += 2; | - |
946 | }executed 18 times by 1 test: end of block | 18 |
947 | | - |
948 | | - |
949 | --i; | - |
950 | | - |
951 | if (want_quotesTRUE | evaluated 6 times by 1 test | FALSE | evaluated 127 times by 1 test |
) | 6-127 |
952 | { | - |
953 | char *x; | - |
954 | | - |
955 | if (want_quotes == 'q'TRUE | evaluated 5 times by 1 test | FALSE | evaluated 1 time by 1 test |
) | 1-5 |
956 | x = sh_single_quote (temp);executed 5 times by 1 test: x = sh_single_quote (temp); | 5 |
957 | else if (want_quotes == 'x'TRUE | evaluated 1 time by 1 test | FALSE | never evaluated |
) | 0-1 |
958 | x = quote_breaks (temp);executed 1 time by 1 test: x = quote_breaks (temp); | 1 |
959 | else | - |
960 | x = strcpy (xmalloc (1 + strlen (temp)), (temp)); never executed: x = strcpy (xmalloc (1 + strlen (temp)), (temp)); | 0 |
961 | | - |
962 | xfree (temp); | - |
963 | temp = x; | - |
964 | }executed 6 times by 1 test: end of block | 6 |
965 | | - |
966 | n = strlen (temp); | - |
967 | if (n >= result_lenTRUE | never evaluated | FALSE | evaluated 133 times by 1 test |
) | 0-133 |
968 | result = (char *)xrealloc (result, n + 2); never executed: result = (char *)xrealloc (result, n + 2); | 0 |
969 | strcpy (result, temp); | - |
970 | xfree (temp); | - |
971 | | - |
972 | *end_index_ptr = i; | - |
973 | *ret_string = result; | - |
974 | returnexecuted 133 times by 1 test: return (print_only); (print_only);executed 133 times by 1 test: return (print_only); | 133 |
975 | } | - |
976 | int | - |
977 | history_expand (char *hstring, char **output) | - |
978 | { | - |
979 | register int j; | - |
980 | int i, r, l, passc, cc, modified, eindex, only_printing, dquote, squote, flag; | - |
981 | char *string; | - |
982 | | - |
983 | | - |
984 | int result_len; | - |
985 | char *result; | - |
986 | | - |
987 | | - |
988 | char mb[ | - |
989 | 16 | - |
990 | ]; | - |
991 | mbstate_t ps; | - |
992 | | - |
993 | | - |
994 | | - |
995 | char *temp; | - |
996 | | - |
997 | if (output == 0TRUE | never evaluated | FALSE | evaluated 213 times by 1 test |
) | 0-213 |
998 | return never executed: return 0; 0;never executed: return 0; | 0 |
999 | | - |
1000 | | - |
1001 | | - |
1002 | if (history_expansion_char == 0TRUE | never evaluated | FALSE | evaluated 213 times by 1 test |
) | 0-213 |
1003 | { | - |
1004 | *output = strcpy (xmalloc (1 + strlen (hstring)), (hstring)); | - |
1005 | return never executed: return (0); (0);never executed: return (0); | 0 |
1006 | } | - |
1007 | | - |
1008 | | - |
1009 | result = (char *)xmalloc (result_len = 256); | - |
1010 | result[0] = '\0'; | - |
1011 | | - |
1012 | only_printing = modified = 0; | - |
1013 | l = strlen (hstring); | - |
1014 | if (hstring[0] == history_subst_charTRUE | evaluated 1 time by 1 test | FALSE | evaluated 212 times by 1 test |
) | 1-212 |
1015 | { | - |
1016 | string = (char *)xmalloc (l + 5); | - |
1017 | | - |
1018 | string[0] = string[1] = history_expansion_char; | - |
1019 | string[2] = ':'; | - |
1020 | string[3] = 's'; | - |
1021 | strcpy (string + 4, hstring); | - |
1022 | l += 4; | - |
1023 | }executed 1 time by 1 test: end of block | 1 |
1024 | else | - |
1025 | { | - |
1026 | | - |
1027 | memset (&ps, 0, sizeof (mbstate_t)); | - |
1028 | | - |
1029 | | - |
1030 | string = hstring; | - |
1031 | | - |
1032 | | - |
1033 | | - |
1034 | | - |
1035 | for (i = dquote = squote = 0; string[i]TRUE | evaluated 2131 times by 1 test | FALSE | evaluated 108 times by 1 test |
; i++) | 108-2131 |
1036 | { | - |
1037 | | - |
1038 | if ( | - |
1039 | (TRUE | evaluated 19 times by 1 test | FALSE | evaluated 2112 times by 1 test |
__ctype_get_mb_cur_max ()) TRUE | evaluated 19 times by 1 test | FALSE | evaluated 2112 times by 1 test |
| 19-2112 |
1040 | > 1TRUE | evaluated 19 times by 1 test | FALSE | evaluated 2112 times by 1 test |
&& rl_byte_oriented == 0TRUE | evaluated 19 times by 1 test | FALSE | never evaluated |
) | 0-2112 |
1041 | { | - |
1042 | int v; | - |
1043 | v = _rl_get_char_len (string + i, &ps); | - |
1044 | if (v > 1TRUE | never evaluated | FALSE | evaluated 19 times by 1 test |
) | 0-19 |
1045 | { | - |
1046 | i += v - 1; | - |
1047 | continue; never executed: continue; | 0 |
1048 | } | - |
1049 | }executed 19 times by 1 test: end of block | 19 |
1050 | | - |
1051 | | - |
1052 | cc = string[i + 1]; | - |
1053 | | - |
1054 | | - |
1055 | | - |
1056 | | - |
1057 | if (history_comment_charTRUE | evaluated 2128 times by 1 test | FALSE | evaluated 3 times by 1 test |
&& string[i] == history_comment_charTRUE | evaluated 2 times by 1 test | FALSE | evaluated 2126 times by 1 test |
&& | 2-2128 |
1058 | dquote == 0TRUE | evaluated 1 time by 1 test | FALSE | evaluated 1 time by 1 test |
&& | 1 |
1059 | (i == 0TRUE | never evaluated | FALSE | evaluated 1 time by 1 test |
|| ((TRUE | evaluated 1 time by 1 test | FALSE | never evaluated |
string[i - 1]) ? ((char *)TRUE | evaluated 1 time by 1 test | FALSE | never evaluated |
| 0-1 |
1060 | (__extension__ (__builtin_constant_p (TRUE | evaluated 1 time by 1 test | FALSE | never evaluated |
| 0-1 |
1061 | (string[i - 1])TRUE | evaluated 1 time by 1 test | FALSE | never evaluated |
| 0-1 |
1062 | ) && !__builtin_constant_p (TRUE | evaluated 1 time by 1 test | FALSE | never evaluated |
| 0-1 |
1063 | (history_word_delimiters)TRUE | evaluated 1 time by 1 test | FALSE | never evaluated |
| 0-1 |
1064 | ) && (TRUE | evaluated 1 time by 1 test | FALSE | never evaluated |
| 0-1 |
1065 | (string[i - 1])TRUE | evaluated 1 time by 1 test | FALSE | never evaluated |
| 0-1 |
1066 | ) == '\0' ? (char *) __rawmemchr (TRUE | evaluated 1 time by 1 test | FALSE | never evaluated |
| 0-1 |
1067 | (history_word_delimiters)TRUE | evaluated 1 time by 1 test | FALSE | never evaluated |
| 0-1 |
1068 | , TRUE | evaluated 1 time by 1 test | FALSE | never evaluated |
| 0-1 |
1069 | (string[i - 1])TRUE | evaluated 1 time by 1 test | FALSE | never evaluated |
| 0-1 |
1070 | ) : __builtin_strchr (TRUE | evaluated 1 time by 1 test | FALSE | never evaluated |
| 0-1 |
1071 | (history_word_delimiters)TRUE | evaluated 1 time by 1 test | FALSE | never evaluated |
| 0-1 |
1072 | , TRUE | evaluated 1 time by 1 test | FALSE | never evaluated |
| 0-1 |
1073 | (string[i - 1])TRUE | evaluated 1 time by 1 test | FALSE | never evaluated |
| 0-1 |
1074 | ))) TRUE | evaluated 1 time by 1 test | FALSE | never evaluated |
| 0-1 |
1075 | != (char *)TRUE | evaluated 1 time by 1 test | FALSE | never evaluated |
| 0-1 |
1076 | ((void *)0)TRUE | evaluated 1 time by 1 test | FALSE | never evaluated |
| 0-1 |
1077 | ) : 0)TRUE | evaluated 1 time by 1 test | FALSE | never evaluated |
)) | 0-1 |
1078 | { | - |
1079 | while (string[i]TRUE | evaluated 7 times by 1 test | FALSE | evaluated 1 time by 1 test |
) | 1-7 |
1080 | i++;executed 7 times by 1 test: i++; | 7 |
1081 | break;executed 1 time by 1 test: break; | 1 |
1082 | } | - |
1083 | else if (string[i] == history_expansion_charTRUE | evaluated 165 times by 1 test | FALSE | evaluated 1965 times by 1 test |
) | 165-1965 |
1084 | { | - |
1085 | if (cc == 0TRUE | evaluated 9 times by 1 test | FALSE | evaluated 156 times by 1 test |
|| ((TRUE | evaluated 156 times by 1 test | FALSE | never evaluated |
TRUE | evaluated 11 times by 1 test | FALSE | evaluated 145 times by 1 test |
cc)TRUE | evaluated 156 times by 1 test | FALSE | never evaluated |
? ((char *)TRUE | evaluated 11 times by 1 test | FALSE | evaluated 145 times by 1 test |
| 0-156 |
1086 | (__extension__ (__builtin_constant_p (TRUE | evaluated 11 times by 1 test | FALSE | evaluated 145 times by 1 test |
| 11-145 |
1087 | (cc)TRUE | evaluated 11 times by 1 test | FALSE | evaluated 145 times by 1 test |
| 11-145 |
1088 | ) && !__builtin_constant_p (TRUE | evaluated 11 times by 1 test | FALSE | evaluated 145 times by 1 test |
| 11-145 |
1089 | (history_no_expand_chars)TRUE | evaluated 11 times by 1 test | FALSE | evaluated 145 times by 1 test |
| 11-145 |
1090 | ) && (TRUE | evaluated 11 times by 1 test | FALSE | evaluated 145 times by 1 test |
| 11-145 |
1091 | (cc)TRUE | evaluated 11 times by 1 test | FALSE | evaluated 145 times by 1 test |
| 11-145 |
1092 | ) == '\0' ? (char *) __rawmemchr (TRUE | evaluated 11 times by 1 test | FALSE | evaluated 145 times by 1 test |
| 11-145 |
1093 | (history_no_expand_chars)TRUE | evaluated 11 times by 1 test | FALSE | evaluated 145 times by 1 test |
| 11-145 |
1094 | , TRUE | evaluated 11 times by 1 test | FALSE | evaluated 145 times by 1 test |
| 11-145 |
1095 | (cc)TRUE | evaluated 11 times by 1 test | FALSE | evaluated 145 times by 1 test |
| 11-145 |
1096 | ) : __builtin_strchr (TRUE | evaluated 11 times by 1 test | FALSE | evaluated 145 times by 1 test |
| 11-145 |
1097 | (history_no_expand_chars)TRUE | evaluated 11 times by 1 test | FALSE | evaluated 145 times by 1 test |
| 11-145 |
1098 | , TRUE | evaluated 11 times by 1 test | FALSE | evaluated 145 times by 1 test |
| 11-145 |
1099 | (cc)TRUE | evaluated 11 times by 1 test | FALSE | evaluated 145 times by 1 test |
| 11-145 |
1100 | ))) TRUE | evaluated 11 times by 1 test | FALSE | evaluated 145 times by 1 test |
| 11-145 |
1101 | != (char *)TRUE | evaluated 11 times by 1 test | FALSE | evaluated 145 times by 1 test |
| 11-145 |
1102 | ((void *)0)TRUE | evaluated 11 times by 1 test | FALSE | evaluated 145 times by 1 test |
| 11-145 |
1103 | ) : 0)TRUE | evaluated 11 times by 1 test | FALSE | evaluated 145 times by 1 test |
) | 11-145 |
1104 | continue;executed 20 times by 1 test: continue; | 20 |
1105 | | - |
1106 | | - |
1107 | | - |
1108 | | - |
1109 | | - |
1110 | else if (dquoteTRUE | evaluated 51 times by 1 test | FALSE | evaluated 94 times by 1 test |
&& cc == '"'TRUE | evaluated 16 times by 1 test | FALSE | evaluated 35 times by 1 test |
) | 16-94 |
1111 | continue;executed 16 times by 1 test: continue; | 16 |
1112 | | - |
1113 | | - |
1114 | | - |
1115 | | - |
1116 | | - |
1117 | else if (history_inhibit_expansion_functionTRUE | evaluated 129 times by 1 test | FALSE | never evaluated |
&& | 0-129 |
1118 | (*TRUE | evaluated 26 times by 1 test | FALSE | evaluated 103 times by 1 test |
history_inhibit_expansion_function) (string, i)TRUE | evaluated 26 times by 1 test | FALSE | evaluated 103 times by 1 test |
) | 26-103 |
1119 | continue;executed 26 times by 1 test: continue; | 26 |
1120 | else | - |
1121 | break;executed 103 times by 1 test: break; | 103 |
1122 | } | - |
1123 | | - |
1124 | | - |
1125 | else if (dquoteTRUE | evaluated 443 times by 1 test | FALSE | evaluated 1522 times by 1 test |
&& string[i] == '\\'TRUE | evaluated 4 times by 1 test | FALSE | evaluated 439 times by 1 test |
&& cc == '"'TRUE | never evaluated | FALSE | evaluated 4 times by 1 test |
) | 0-1522 |
1126 | i++; never executed: i++; | 0 |
1127 | | - |
1128 | | - |
1129 | | - |
1130 | | - |
1131 | else if (history_quotes_inhibit_expansionTRUE | evaluated 1965 times by 1 test | FALSE | never evaluated |
&& string[i] == '"'TRUE | evaluated 156 times by 1 test | FALSE | evaluated 1809 times by 1 test |
) | 0-1965 |
1132 | { | - |
1133 | dquote = 1 - dquote; | - |
1134 | }executed 156 times by 1 test: end of block | 156 |
1135 | else if (dquote == 0TRUE | evaluated 1433 times by 1 test | FALSE | evaluated 376 times by 1 test |
&& history_quotes_inhibit_expansionTRUE | evaluated 1433 times by 1 test | FALSE | never evaluated |
&& string[i] == '\''TRUE | evaluated 54 times by 1 test | FALSE | evaluated 1379 times by 1 test |
) | 0-1433 |
1136 | { | - |
1137 | | - |
1138 | flag = (i > 0TRUE | evaluated 54 times by 1 test | FALSE | never evaluated |
&& string[i - 1] == '$'TRUE | evaluated 2 times by 1 test | FALSE | evaluated 52 times by 1 test |
); | 0-54 |
1139 | i++; | - |
1140 | hist_string_extract_single_quoted (string, &i, flag); | - |
1141 | }executed 54 times by 1 test: end of block | 54 |
1142 | else if (history_quotes_inhibit_expansionTRUE | evaluated 1755 times by 1 test | FALSE | never evaluated |
&& string[i] == '\\'TRUE | evaluated 17 times by 1 test | FALSE | evaluated 1738 times by 1 test |
) | 0-1755 |
1143 | { | - |
1144 | | - |
1145 | | - |
1146 | if (cc == '\''TRUE | never evaluated | FALSE | evaluated 17 times by 1 test |
|| cc == history_expansion_charTRUE | evaluated 17 times by 1 test | FALSE | never evaluated |
) | 0-17 |
1147 | i++;executed 17 times by 1 test: i++; | 17 |
1148 | }executed 17 times by 1 test: end of block | 17 |
1149 | | - |
1150 | }executed 1965 times by 1 test: end of block | 1965 |
1151 | | - |
1152 | if (string[i] != history_expansion_charTRUE | evaluated 109 times by 1 test | FALSE | evaluated 103 times by 1 test |
) | 103-109 |
1153 | { | - |
1154 | xfree (result); | - |
1155 | *output = strcpy (xmalloc (1 + strlen (string)), (string)); | - |
1156 | returnexecuted 109 times by 1 test: return (0); (0);executed 109 times by 1 test: return (0); | 109 |
1157 | } | - |
1158 | }executed 103 times by 1 test: end of block | 103 |
1159 | | - |
1160 | | - |
1161 | for (passc = dquote = squote = i = j = 0; i < lTRUE | evaluated 1088 times by 1 test | FALSE | evaluated 102 times by 1 test |
; i++) | 102-1088 |
1162 | { | - |
1163 | int qc, tchar = string[i]; | - |
1164 | | - |
1165 | if (passcTRUE | evaluated 8 times by 1 test | FALSE | evaluated 1080 times by 1 test |
) | 8-1080 |
1166 | { | - |
1167 | passc = 0; | - |
1168 | do { if (j >= result_len - 1TRUE | never evaluated | FALSE | evaluated 8 times by 1 test |
) result = (char *)xrealloc (result, result_len += 64);never executed: result = (char *)xrealloc (result, result_len += 64); result[j++] = tchar; result[j] = '\0'; } while (0); | 0-8 |
1169 | continue;executed 8 times by 1 test: continue; | 8 |
1170 | } | - |
1171 | | - |
1172 | | - |
1173 | if ( | - |
1174 | (TRUE | evaluated 5 times by 1 test | FALSE | evaluated 1075 times by 1 test |
__ctype_get_mb_cur_max ()) TRUE | evaluated 5 times by 1 test | FALSE | evaluated 1075 times by 1 test |
| 5-1075 |
1175 | > 1TRUE | evaluated 5 times by 1 test | FALSE | evaluated 1075 times by 1 test |
&& rl_byte_oriented == 0TRUE | evaluated 5 times by 1 test | FALSE | never evaluated |
) | 0-1075 |
1176 | { | - |
1177 | int k, c; | - |
1178 | | - |
1179 | c = tchar; | - |
1180 | memset (mb, 0, sizeof (mb)); | - |
1181 | for (k = 0; k < TRUE | evaluated 5 times by 1 test | FALSE | never evaluated |
| 0-5 |
1182 | 16TRUE | evaluated 5 times by 1 test | FALSE | never evaluated |
| 0-5 |
1183 | ; k++) | - |
1184 | { | - |
1185 | mb[k] = (char)c; | - |
1186 | memset (&ps, 0, sizeof (mbstate_t)); | - |
1187 | if (_rl_get_char_len (mb, &ps) == -2TRUE | never evaluated | FALSE | evaluated 5 times by 1 test |
) | 0-5 |
1188 | c = string[++i]; never executed: c = string[++i]; | 0 |
1189 | else | - |
1190 | break;executed 5 times by 1 test: break; | 5 |
1191 | } | - |
1192 | if (strlen (mb) > 1TRUE | never evaluated | FALSE | evaluated 5 times by 1 test |
) | 0-5 |
1193 | { | - |
1194 | do { int sl = strlen (mb); j += sl; if (j >= result_lenTRUE | never evaluated | FALSE | never evaluated |
) { while (j >= result_lenTRUE | never evaluated | FALSE | never evaluated |
) result_len += 128;never executed: result_len += 128; result = (char *)xrealloc (result, result_len); }never executed: end of block strcpy (result + j - sl, mb); } while (0); | 0 |
1195 | continue; never executed: continue; | 0 |
1196 | } | - |
1197 | }executed 5 times by 1 test: end of block | 5 |
1198 | | - |
1199 | | - |
1200 | if (tchar == history_expansion_charTRUE | evaluated 136 times by 1 test | FALSE | evaluated 944 times by 1 test |
) | 136-944 |
1201 | tchar = -3;executed 136 times by 1 test: tchar = -3; | 136 |
1202 | else if (tchar == history_comment_charTRUE | evaluated 1 time by 1 test | FALSE | evaluated 943 times by 1 test |
) | 1-943 |
1203 | tchar = -2;executed 1 time by 1 test: tchar = -2; | 1 |
1204 | | - |
1205 | switch (tchar) | - |
1206 | { | - |
1207 | defaultexecuted 862 times by 1 test: default: :executed 862 times by 1 test: default: | 862 |
1208 | do { if (j >= result_len - 1TRUE | never evaluated | FALSE | evaluated 862 times by 1 test |
) result = (char *)xrealloc (result, result_len += 64);never executed: result = (char *)xrealloc (result, result_len += 64); result[j++] = string[i]; result[j] = '\0'; } while (0); | 0-862 |
1209 | break;executed 862 times by 1 test: break; | 862 |
1210 | | - |
1211 | caseexecuted 8 times by 1 test: case '\\': '\\':executed 8 times by 1 test: case '\\': | 8 |
1212 | passc++; | - |
1213 | do { if (j >= result_len - 1TRUE | never evaluated | FALSE | evaluated 8 times by 1 test |
) result = (char *)xrealloc (result, result_len += 64);never executed: result = (char *)xrealloc (result, result_len += 64); result[j++] = tchar; result[j] = '\0'; } while (0); | 0-8 |
1214 | break;executed 8 times by 1 test: break; | 8 |
1215 | | - |
1216 | caseexecuted 71 times by 1 test: case '"': '"':executed 71 times by 1 test: case '"': | 71 |
1217 | dquote = 1 - dquote; | - |
1218 | do { if (j >= result_len - 1TRUE | never evaluated | FALSE | evaluated 71 times by 1 test |
) result = (char *)xrealloc (result, result_len += 64);never executed: result = (char *)xrealloc (result, result_len += 64); result[j++] = tchar; result[j] = '\0'; } while (0); | 0-71 |
1219 | break;executed 71 times by 1 test: break; | 71 |
1220 | | - |
1221 | caseexecuted 2 times by 1 test: case '\'': '\'':executed 2 times by 1 test: case '\'': | 2 |
1222 | { | - |
1223 | | - |
1224 | | - |
1225 | | - |
1226 | if (squoteTRUE | never evaluated | FALSE | evaluated 2 times by 1 test |
) | 0-2 |
1227 | { | - |
1228 | squote = 0; | - |
1229 | do { if (j >= result_len - 1TRUE | never evaluated | FALSE | never evaluated |
) result = (char *)xrealloc (result, result_len += 64);never executed: result = (char *)xrealloc (result, result_len += 64); result[j++] = tchar; result[j] = '\0'; } while (0); | 0 |
1230 | } never executed: end of block | 0 |
1231 | else if (dquote == 0TRUE | evaluated 1 time by 1 test | FALSE | evaluated 1 time by 1 test |
&& history_quotes_inhibit_expansionTRUE | evaluated 1 time by 1 test | FALSE | never evaluated |
) | 0-1 |
1232 | { | - |
1233 | int quote, slen; | - |
1234 | | - |
1235 | flag = (i > 0TRUE | evaluated 1 time by 1 test | FALSE | never evaluated |
&& string[i - 1] == '$'TRUE | never evaluated | FALSE | evaluated 1 time by 1 test |
); | 0-1 |
1236 | quote = i++; | - |
1237 | hist_string_extract_single_quoted (string, &i, flag); | - |
1238 | | - |
1239 | slen = i - quote + 2; | - |
1240 | temp = (char *)xmalloc (slen); | - |
1241 | | - |
1242 | __builtin_strncpy ( | - |
1243 | temp | - |
1244 | , | - |
1245 | string + quote | - |
1246 | , | - |
1247 | slen | - |
1248 | ) | - |
1249 | ; | - |
1250 | temp[slen - 1] = '\0'; | - |
1251 | do { int sl = strlen (temp); j += sl; if (j >= result_lenTRUE | never evaluated | FALSE | evaluated 1 time by 1 test |
) { while (j >= result_lenTRUE | never evaluated | FALSE | never evaluated |
) result_len += 128;never executed: result_len += 128; result = (char *)xrealloc (result, result_len); }never executed: end of block strcpy (result + j - sl, temp); } while (0); | 0-1 |
1252 | xfree (temp); | - |
1253 | }executed 1 time by 1 test: end of block | 1 |
1254 | else if (dquote == 0TRUE | never evaluated | FALSE | evaluated 1 time by 1 test |
&& squote == 0TRUE | never evaluated | FALSE | never evaluated |
&& history_quotes_inhibit_expansion == 0TRUE | never evaluated | FALSE | never evaluated |
) | 0-1 |
1255 | { | - |
1256 | squote = 1; | - |
1257 | do { if (j >= result_len - 1TRUE | never evaluated | FALSE | never evaluated |
) result = (char *)xrealloc (result, result_len += 64);never executed: result = (char *)xrealloc (result, result_len += 64); result[j++] = string[i]; result[j] = '\0'; } while (0); | 0 |
1258 | } never executed: end of block | 0 |
1259 | else | - |
1260 | do { if (j >= result_len - 1TRUE | never evaluated | FALSE | evaluated 1 time by 1 test |
) result = (char *)xrealloc (result, result_len += 64);never executed: result = (char *)xrealloc (result, result_len += 64); result[j++] = string[i]; result[j] = '\0'; }executed 1 time by 1 test: end of block while (0); | 0-1 |
1261 | break;executed 2 times by 1 test: break; | 2 |
1262 | } | - |
1263 | | - |
1264 | caseexecuted 1 time by 1 test: case -2: -2:executed 1 time by 1 test: case -2: | 1 |
1265 | if ((dquote == 0TRUE | never evaluated | FALSE | evaluated 1 time by 1 test |
|| history_quotes_inhibit_expansion == 0TRUE | never evaluated | FALSE | evaluated 1 time by 1 test |
) && | 0-1 |
1266 | (i == 0TRUE | never evaluated | FALSE | never evaluated |
|| ((TRUE | never evaluated | FALSE | never evaluated |
string[i - 1]) ? ((char *)TRUE | never evaluated | FALSE | never evaluated |
| 0 |
1267 | (__extension__ (__builtin_constant_p (TRUE | never evaluated | FALSE | never evaluated |
| 0 |
1268 | (string[i - 1])TRUE | never evaluated | FALSE | never evaluated |
| 0 |
1269 | ) && !__builtin_constant_p (TRUE | never evaluated | FALSE | never evaluated |
| 0 |
1270 | (history_word_delimiters)TRUE | never evaluated | FALSE | never evaluated |
| 0 |
1271 | ) && (TRUE | never evaluated | FALSE | never evaluated |
| 0 |
1272 | (string[i - 1])TRUE | never evaluated | FALSE | never evaluated |
| 0 |
1273 | ) == '\0' ? (char *) __rawmemchr (TRUE | never evaluated | FALSE | never evaluated |
| 0 |
1274 | (history_word_delimiters)TRUE | never evaluated | FALSE | never evaluated |
| 0 |
1275 | , TRUE | never evaluated | FALSE | never evaluated |
| 0 |
1276 | (string[i - 1])TRUE | never evaluated | FALSE | never evaluated |
| 0 |
1277 | ) : __builtin_strchr (TRUE | never evaluated | FALSE | never evaluated |
| 0 |
1278 | (history_word_delimiters)TRUE | never evaluated | FALSE | never evaluated |
| 0 |
1279 | , TRUE | never evaluated | FALSE | never evaluated |
| 0 |
1280 | (string[i - 1])TRUE | never evaluated | FALSE | never evaluated |
| 0 |
1281 | ))) TRUE | never evaluated | FALSE | never evaluated |
| 0 |
1282 | != (char *)TRUE | never evaluated | FALSE | never evaluated |
| 0 |
1283 | ((void *)0)TRUE | never evaluated | FALSE | never evaluated |
| 0 |
1284 | ) : 0)TRUE | never evaluated | FALSE | never evaluated |
)) | 0 |
1285 | { | - |
1286 | temp = (char *)xmalloc (l - i + 1); | - |
1287 | strcpy (temp, string + i); | - |
1288 | do { int sl = strlen (temp); j += sl; if (j >= result_lenTRUE | never evaluated | FALSE | never evaluated |
) { while (j >= result_lenTRUE | never evaluated | FALSE | never evaluated |
) result_len += 128;never executed: result_len += 128; result = (char *)xrealloc (result, result_len); }never executed: end of block strcpy (result + j - sl, temp); } while (0); | 0 |
1289 | xfree (temp); | - |
1290 | i = l; | - |
1291 | } never executed: end of block | 0 |
1292 | else | - |
1293 | do { if (j >= result_len - 1TRUE | never evaluated | FALSE | evaluated 1 time by 1 test |
) result = (char *)xrealloc (result, result_len += 64);never executed: result = (char *)xrealloc (result, result_len += 64); result[j++] = string[i]; result[j] = '\0'; }executed 1 time by 1 test: end of block while (0); | 0-1 |
1294 | break;executed 1 time by 1 test: break; | 1 |
1295 | | - |
1296 | caseexecuted 136 times by 1 test: case -3: -3:executed 136 times by 1 test: case -3: | 136 |
1297 | cc = string[i + 1]; | - |
1298 | | - |
1299 | | - |
1300 | | - |
1301 | | - |
1302 | if (cc == 0TRUE | never evaluated | FALSE | evaluated 136 times by 1 test |
|| ((TRUE | never evaluated | FALSE | evaluated 136 times by 1 test |
cc) ? ((char *)TRUE | never evaluated | FALSE | evaluated 136 times by 1 test |
| 0-136 |
1303 | (__extension__ (__builtin_constant_p (TRUE | never evaluated | FALSE | evaluated 136 times by 1 test |
| 0-136 |
1304 | (cc)TRUE | never evaluated | FALSE | evaluated 136 times by 1 test |
| 0-136 |
1305 | ) && !__builtin_constant_p (TRUE | never evaluated | FALSE | evaluated 136 times by 1 test |
| 0-136 |
1306 | (history_no_expand_chars)TRUE | never evaluated | FALSE | evaluated 136 times by 1 test |
| 0-136 |
1307 | ) && (TRUE | never evaluated | FALSE | evaluated 136 times by 1 test |
| 0-136 |
1308 | (cc)TRUE | never evaluated | FALSE | evaluated 136 times by 1 test |
| 0-136 |
1309 | ) == '\0' ? (char *) __rawmemchr (TRUE | never evaluated | FALSE | evaluated 136 times by 1 test |
| 0-136 |
1310 | (history_no_expand_chars)TRUE | never evaluated | FALSE | evaluated 136 times by 1 test |
| 0-136 |
1311 | , TRUE | never evaluated | FALSE | evaluated 136 times by 1 test |
| 0-136 |
1312 | (cc)TRUE | never evaluated | FALSE | evaluated 136 times by 1 test |
| 0-136 |
1313 | ) : __builtin_strchr (TRUE | never evaluated | FALSE | evaluated 136 times by 1 test |
| 0-136 |
1314 | (history_no_expand_chars)TRUE | never evaluated | FALSE | evaluated 136 times by 1 test |
| 0-136 |
1315 | , TRUE | never evaluated | FALSE | evaluated 136 times by 1 test |
| 0-136 |
1316 | (cc)TRUE | never evaluated | FALSE | evaluated 136 times by 1 test |
| 0-136 |
1317 | ))) TRUE | never evaluated | FALSE | evaluated 136 times by 1 test |
| 0-136 |
1318 | != (char *)TRUE | never evaluated | FALSE | evaluated 136 times by 1 test |
| 0-136 |
1319 | ((void *)0)TRUE | never evaluated | FALSE | evaluated 136 times by 1 test |
| 0-136 |
1320 | ) : 0)TRUE | never evaluated | FALSE | evaluated 136 times by 1 test |
|| | 0-136 |
1321 | (dquoteTRUE | evaluated 36 times by 1 test | FALSE | evaluated 100 times by 1 test |
&& cc == '"'TRUE | never evaluated | FALSE | evaluated 36 times by 1 test |
) || | 0-100 |
1322 | (history_inhibit_expansion_functionTRUE | evaluated 136 times by 1 test | FALSE | never evaluated |
&& (*TRUE | evaluated 1 time by 1 test | FALSE | evaluated 135 times by 1 test |
history_inhibit_expansion_function) (string, i)TRUE | evaluated 1 time by 1 test | FALSE | evaluated 135 times by 1 test |
)) | 0-136 |
1323 | { | - |
1324 | do { if (j >= result_len - 1TRUE | never evaluated | FALSE | evaluated 1 time by 1 test |
) result = (char *)xrealloc (result, result_len += 64);never executed: result = (char *)xrealloc (result, result_len += 64); result[j++] = string[i]; result[j] = '\0'; } while (0); | 0-1 |
1325 | break;executed 1 time by 1 test: break; | 1 |
1326 | } | - |
1327 | qc = squoteTRUE | never evaluated | FALSE | evaluated 135 times by 1 test |
? '\'' : (dquoteTRUE | evaluated 35 times by 1 test | FALSE | evaluated 100 times by 1 test |
? '"' : 0); | 0-135 |
1328 | r = history_expand_internal (string, i, qc, &eindex, &temp, result); | - |
1329 | if (r < 0TRUE | evaluated 2 times by 1 test | FALSE | evaluated 133 times by 1 test |
) | 2-133 |
1330 | { | - |
1331 | *output = temp; | - |
1332 | xfree (result); | - |
1333 | if (string != hstringTRUE | never evaluated | FALSE | evaluated 2 times by 1 test |
) | 0-2 |
1334 | xfree (string); never executed: xfree (string); | 0 |
1335 | returnexecuted 2 times by 1 test: return -1; -1;executed 2 times by 1 test: return -1; | 2 |
1336 | } | - |
1337 | else | - |
1338 | { | - |
1339 | if (tempTRUE | evaluated 133 times by 1 test | FALSE | never evaluated |
) | 0-133 |
1340 | { | - |
1341 | modified++; | - |
1342 | if (*TRUE | evaluated 133 times by 1 test | FALSE | never evaluated |
tempTRUE | evaluated 133 times by 1 test | FALSE | never evaluated |
) | 0-133 |
1343 | do { int sl = strlen (temp); j += sl; if (j >= result_lenTRUE | never evaluated | FALSE | evaluated 133 times by 1 test |
) { while (j >= result_lenTRUE | never evaluated | FALSE | never evaluated |
) result_len += 128;never executed: result_len += 128; result = (char *)xrealloc (result, result_len); }never executed: end of block strcpy (result + j - sl, temp); }executed 133 times by 1 test: end of block while (0); | 0-133 |
1344 | xfree (temp); | - |
1345 | }executed 133 times by 1 test: end of block | 133 |
1346 | only_printing += r == 1; | - |
1347 | i = eindex; | - |
1348 | }executed 133 times by 1 test: end of block | 133 |
1349 | break;executed 133 times by 1 test: break; | 133 |
1350 | } | - |
1351 | } | - |
1352 | | - |
1353 | *output = result; | - |
1354 | if (string != hstringTRUE | evaluated 1 time by 1 test | FALSE | evaluated 101 times by 1 test |
) | 1-101 |
1355 | xfree (string);executed 1 time by 1 test: xfree (string); | 1 |
1356 | | - |
1357 | if (only_printingTRUE | evaluated 3 times by 1 test | FALSE | evaluated 99 times by 1 test |
) | 3-99 |
1358 | { | - |
1359 | | - |
1360 | | - |
1361 | | - |
1362 | returnexecuted 3 times by 1 test: return (2); (2);executed 3 times by 1 test: return (2); | 3 |
1363 | } | - |
1364 | | - |
1365 | returnexecuted 99 times by 1 test: return (modified != 0); (modified != 0);executed 99 times by 1 test: return (modified != 0); | 99 |
1366 | } | - |
1367 | | - |
1368 | | - |
1369 | | - |
1370 | | - |
1371 | | - |
1372 | | - |
1373 | static char * | - |
1374 | get_history_word_specifier (char *spec, char *from, int *caller_index) | - |
1375 | { | - |
1376 | register int i = *caller_index; | - |
1377 | int first, last; | - |
1378 | int expecting_word_spec = 0; | - |
1379 | char *result; | - |
1380 | | - |
1381 | | - |
1382 | first = last = 0; | - |
1383 | result = (char *) | - |
1384 | ((void *)0) | - |
1385 | ; | - |
1386 | | - |
1387 | | - |
1388 | | - |
1389 | if (spec[i] == ':'TRUE | evaluated 32 times by 1 test | FALSE | evaluated 102 times by 1 test |
) | 32-102 |
1390 | { | - |
1391 | i++; | - |
1392 | expecting_word_spec++; | - |
1393 | }executed 32 times by 1 test: end of block | 32 |
1394 | | - |
1395 | | - |
1396 | | - |
1397 | | - |
1398 | if (spec[i] == '%'TRUE | evaluated 2 times by 1 test | FALSE | evaluated 132 times by 1 test |
) | 2-132 |
1399 | { | - |
1400 | *caller_index = i + 1; | - |
1401 | returnexecuted 2 times by 1 test: return (search_match ? strcpy (xmalloc (1 + strlen (search_match)), (search_match)) : strcpy (xmalloc (1 + strlen ("")), (""))); (search_match ? strcpy (xmalloc (1 + strlen (search_match)), (search_match)) : strcpy (xmalloc (1 + strlen ("")), ("")));executed 2 times by 1 test: return (search_match ? strcpy (xmalloc (1 + strlen (search_match)), (search_match)) : strcpy (xmalloc (1 + strlen ("")), (""))); | 2 |
1402 | } | - |
1403 | | - |
1404 | | - |
1405 | if (spec[i] == '*'TRUE | evaluated 3 times by 1 test | FALSE | evaluated 129 times by 1 test |
) | 3-129 |
1406 | { | - |
1407 | *caller_index = i + 1; | - |
1408 | result = history_arg_extract (1, '$', from); | - |
1409 | returnexecuted 3 times by 1 test: return (result ? result : strcpy (xmalloc (1 + strlen ("")), (""))); (result ? result : strcpy (xmalloc (1 + strlen ("")), ("")));executed 3 times by 1 test: return (result ? result : strcpy (xmalloc (1 + strlen ("")), (""))); | 3 |
1410 | } | - |
1411 | | - |
1412 | | - |
1413 | if (spec[i] == '$'TRUE | evaluated 7 times by 1 test | FALSE | evaluated 122 times by 1 test |
) | 7-122 |
1414 | { | - |
1415 | *caller_index = i + 1; | - |
1416 | returnexecuted 7 times by 1 test: return (history_arg_extract ('$', '$', from)); (history_arg_extract ('$', '$', from));executed 7 times by 1 test: return (history_arg_extract ('$', '$', from)); | 7 |
1417 | } | - |
1418 | | - |
1419 | | - |
1420 | | - |
1421 | if (spec[i] == '-'TRUE | evaluated 3 times by 1 test | FALSE | evaluated 119 times by 1 test |
) | 3-119 |
1422 | first = 0;executed 3 times by 1 test: first = 0; | 3 |
1423 | else if (spec[i] == '^'TRUE | evaluated 1 time by 1 test | FALSE | evaluated 118 times by 1 test |
) | 1-118 |
1424 | { | - |
1425 | first = 1; | - |
1426 | i++; | - |
1427 | }executed 1 time by 1 test: end of block | 1 |
1428 | else if (((TRUE | evaluated 31 times by 1 test | FALSE | evaluated 87 times by 1 test |
spec[i]) >= '0'TRUE | evaluated 31 times by 1 test | FALSE | evaluated 87 times by 1 test |
&& (TRUE | evaluated 12 times by 1 test | FALSE | evaluated 19 times by 1 test |
spec[i]) <= '9'TRUE | evaluated 12 times by 1 test | FALSE | evaluated 19 times by 1 test |
) && expecting_word_specTRUE | evaluated 12 times by 1 test | FALSE | never evaluated |
) | 0-87 |
1429 | { | - |
1430 | for (first = 0; ((TRUE | evaluated 16 times by 1 test | FALSE | evaluated 8 times by 1 test |
spec[i]) >= '0'TRUE | evaluated 16 times by 1 test | FALSE | evaluated 8 times by 1 test |
&& (TRUE | evaluated 12 times by 1 test | FALSE | evaluated 4 times by 1 test |
spec[i]) <= '9'TRUE | evaluated 12 times by 1 test | FALSE | evaluated 4 times by 1 test |
); i++) | 4-16 |
1431 | first = (first * 10) + ((spec[i]) - '0');executed 12 times by 1 test: first = (first * 10) + ((spec[i]) - '0'); | 12 |
1432 | }executed 12 times by 1 test: end of block | 12 |
1433 | else | - |
1434 | returnexecuted 106 times by 1 test: return ((char *) ((void *)0) ); ((char *)executed 106 times by 1 test: return ((char *) ((void *)0) ); | 106 |
1435 | ((void *)0)executed 106 times by 1 test: return ((char *) ((void *)0) ); | 106 |
1436 | );executed 106 times by 1 test: return ((char *) ((void *)0) ); | 106 |
1437 | | - |
1438 | if (spec[i] == '^'TRUE | never evaluated | FALSE | evaluated 16 times by 1 test |
|| spec[i] == '*'TRUE | evaluated 1 time by 1 test | FALSE | evaluated 15 times by 1 test |
) | 0-16 |
1439 | { | - |
1440 | last = (TRUE | never evaluated | FALSE | evaluated 1 time by 1 test |
spec[i] == '^')TRUE | never evaluated | FALSE | evaluated 1 time by 1 test |
? 1 : '$'; | 0-1 |
1441 | i++; | - |
1442 | }executed 1 time by 1 test: end of block | 1 |
1443 | else if (spec[i] != '-'TRUE | evaluated 7 times by 1 test | FALSE | evaluated 8 times by 1 test |
) | 7-8 |
1444 | last = first;executed 7 times by 1 test: last = first; | 7 |
1445 | else | - |
1446 | { | - |
1447 | i++; | - |
1448 | | - |
1449 | if (((TRUE | evaluated 2 times by 1 test | FALSE | evaluated 6 times by 1 test |
spec[i]) >= '0'TRUE | evaluated 2 times by 1 test | FALSE | evaluated 6 times by 1 test |
&& (TRUE | evaluated 2 times by 1 test | FALSE | never evaluated |
spec[i]) <= '9'TRUE | evaluated 2 times by 1 test | FALSE | never evaluated |
)) | 0-6 |
1450 | { | - |
1451 | for (last = 0; ((TRUE | evaluated 2 times by 1 test | FALSE | evaluated 2 times by 1 test |
spec[i]) >= '0'TRUE | evaluated 2 times by 1 test | FALSE | evaluated 2 times by 1 test |
&& (TRUE | evaluated 2 times by 1 test | FALSE | never evaluated |
spec[i]) <= '9'TRUE | evaluated 2 times by 1 test | FALSE | never evaluated |
); i++) | 0-2 |
1452 | last = (last * 10) + ((spec[i]) - '0');executed 2 times by 1 test: last = (last * 10) + ((spec[i]) - '0'); | 2 |
1453 | }executed 2 times by 1 test: end of block | 2 |
1454 | else if (spec[i] == '$'TRUE | evaluated 5 times by 1 test | FALSE | evaluated 1 time by 1 test |
) | 1-5 |
1455 | { | - |
1456 | i++; | - |
1457 | last = '$'; | - |
1458 | }executed 5 times by 1 test: end of block | 5 |
1459 | | - |
1460 | | - |
1461 | | - |
1462 | | - |
1463 | else | - |
1464 | | - |
1465 | | - |
1466 | | - |
1467 | last = -1;executed 1 time by 1 test: last = -1; | 1 |
1468 | } | - |
1469 | | - |
1470 | *caller_index = i; | - |
1471 | | - |
1472 | if (last >= firstTRUE | evaluated 15 times by 1 test | FALSE | evaluated 1 time by 1 test |
|| last == '$'TRUE | never evaluated | FALSE | evaluated 1 time by 1 test |
|| last < 0TRUE | evaluated 1 time by 1 test | FALSE | never evaluated |
) | 0-15 |
1473 | result = history_arg_extract (first, last, from);executed 16 times by 1 test: result = history_arg_extract (first, last, from); | 16 |
1474 | | - |
1475 | returnexecuted 16 times by 1 test: return (result ? result : (char *)&error_pointer); (result ? result : (char *)&error_pointer);executed 16 times by 1 test: return (result ? result : (char *)&error_pointer); | 16 |
1476 | } | - |
1477 | | - |
1478 | | - |
1479 | | - |
1480 | | - |
1481 | | - |
1482 | | - |
1483 | char * | - |
1484 | history_arg_extract (int first, int last, const char *string) | - |
1485 | { | - |
1486 | register int i, len; | - |
1487 | char *result; | - |
1488 | int size, offset; | - |
1489 | char **list; | - |
1490 | | - |
1491 | | - |
1492 | | - |
1493 | | - |
1494 | if ((TRUE | never evaluated | FALSE | evaluated 26 times by 1 test |
list = history_tokenize (string)) == TRUE | never evaluated | FALSE | evaluated 26 times by 1 test |
| 0-26 |
1495 | ((void *)0)TRUE | never evaluated | FALSE | evaluated 26 times by 1 test |
| 0-26 |
1496 | ) | - |
1497 | return never executed: return ((char *) ((void *)0) ); ((char *)never executed: return ((char *) ((void *)0) ); | 0 |
1498 | ((void *)0) never executed: return ((char *) ((void *)0) ); | 0 |
1499 | ); never executed: return ((char *) ((void *)0) ); | 0 |
1500 | | - |
1501 | for (len = 0; list[len]TRUE | evaluated 104 times by 1 test | FALSE | evaluated 26 times by 1 test |
; len++) | 26-104 |
1502 | ;executed 104 times by 1 test: ; | 104 |
1503 | | - |
1504 | if (last < 0TRUE | evaluated 1 time by 1 test | FALSE | evaluated 25 times by 1 test |
) | 1-25 |
1505 | last = len + last - 1;executed 1 time by 1 test: last = len + last - 1; | 1 |
1506 | | - |
1507 | if (first < 0TRUE | never evaluated | FALSE | evaluated 26 times by 1 test |
) | 0-26 |
1508 | first = len + first - 1; never executed: first = len + first - 1; | 0 |
1509 | | - |
1510 | if (last == '$'TRUE | evaluated 16 times by 1 test | FALSE | evaluated 10 times by 1 test |
) | 10-16 |
1511 | last = len - 1;executed 16 times by 1 test: last = len - 1; | 16 |
1512 | | - |
1513 | if (first == '$'TRUE | evaluated 7 times by 1 test | FALSE | evaluated 19 times by 1 test |
) | 7-19 |
1514 | first = len - 1;executed 7 times by 1 test: first = len - 1; | 7 |
1515 | | - |
1516 | last++; | - |
1517 | | - |
1518 | if (first >= lenTRUE | never evaluated | FALSE | evaluated 26 times by 1 test |
|| last > lenTRUE | never evaluated | FALSE | evaluated 26 times by 1 test |
|| first < 0TRUE | never evaluated | FALSE | evaluated 26 times by 1 test |
|| last < 0TRUE | never evaluated | FALSE | evaluated 26 times by 1 test |
|| first > lastTRUE | never evaluated | FALSE | evaluated 26 times by 1 test |
) | 0-26 |
1519 | result = ((char *) never executed: result = ((char *) ((void *)0) ); | 0 |
1520 | ((void *)0) never executed: result = ((char *) ((void *)0) ); | 0 |
1521 | ); never executed: result = ((char *) ((void *)0) ); | 0 |
1522 | else | - |
1523 | { | - |
1524 | for (size = 0, i = first; i < lastTRUE | evaluated 51 times by 1 test | FALSE | evaluated 26 times by 1 test |
; i++) | 26-51 |
1525 | size += strlen (list[i]) + 1;executed 51 times by 1 test: size += strlen (list[i]) + 1; | 51 |
1526 | result = (char *)xmalloc (size + 1); | - |
1527 | result[0] = '\0'; | - |
1528 | | - |
1529 | for (i = first, offset = 0; i < lastTRUE | evaluated 51 times by 1 test | FALSE | evaluated 26 times by 1 test |
; i++) | 26-51 |
1530 | { | - |
1531 | strcpy (result + offset, list[i]); | - |
1532 | offset += strlen (list[i]); | - |
1533 | if (i + 1 < lastTRUE | evaluated 25 times by 1 test | FALSE | evaluated 26 times by 1 test |
) | 25-26 |
1534 | { | - |
1535 | result[offset++] = ' '; | - |
1536 | result[offset] = 0; | - |
1537 | }executed 25 times by 1 test: end of block | 25 |
1538 | }executed 51 times by 1 test: end of block | 51 |
1539 | }executed 26 times by 1 test: end of block | 26 |
1540 | | - |
1541 | for (i = 0; i < lenTRUE | evaluated 104 times by 1 test | FALSE | evaluated 26 times by 1 test |
; i++) | 26-104 |
1542 | xfree (list[i]);executed 104 times by 1 test: xfree (list[i]); | 104 |
1543 | xfree (list); | - |
1544 | | - |
1545 | returnexecuted 26 times by 1 test: return (result); (result);executed 26 times by 1 test: return (result); | 26 |
1546 | } | - |
1547 | | - |
1548 | static int | - |
1549 | history_tokenize_word (const char *string, int ind) | - |
1550 | { | - |
1551 | register int i, j; | - |
1552 | int delimiter, nestdelim, delimopen; | - |
1553 | | - |
1554 | i = ind; | - |
1555 | delimiter = nestdelim = 0; | - |
1556 | | - |
1557 | if (((TRUE | evaluated 132 times by 1 test | FALSE | never evaluated |
string[i])TRUE | evaluated 132 times by 1 test | FALSE | never evaluated |
? ((char *)TRUE | never evaluated | FALSE | evaluated 132 times by 1 test |
| 0-132 |
1558 | (__extension__ (__builtin_constant_p (TRUE | never evaluated | FALSE | evaluated 132 times by 1 test |
| 0-132 |
1559 | (string[i])TRUE | never evaluated | FALSE | evaluated 132 times by 1 test |
| 0-132 |
1560 | ) && !__builtin_constant_p (TRUE | never evaluated | FALSE | evaluated 132 times by 1 test |
| 0-132 |
1561 | ("()\n")TRUE | never evaluated | FALSE | evaluated 132 times by 1 test |
| 0-132 |
1562 | ) && (TRUE | never evaluated | FALSE | evaluated 132 times by 1 test |
| 0-132 |
1563 | (string[i])TRUE | never evaluated | FALSE | evaluated 132 times by 1 test |
| 0-132 |
1564 | ) == '\0' ? (char *) __rawmemchr (TRUE | never evaluated | FALSE | evaluated 132 times by 1 test |
| 0-132 |
1565 | ("()\n")TRUE | never evaluated | FALSE | evaluated 132 times by 1 test |
| 0-132 |
1566 | , TRUE | never evaluated | FALSE | evaluated 132 times by 1 test |
| 0-132 |
1567 | (string[i])TRUE | never evaluated | FALSE | evaluated 132 times by 1 test |
| 0-132 |
1568 | ) : __builtin_strchr (TRUE | never evaluated | FALSE | evaluated 132 times by 1 test |
| 0-132 |
1569 | ("()\n")TRUE | never evaluated | FALSE | evaluated 132 times by 1 test |
| 0-132 |
1570 | , TRUE | never evaluated | FALSE | evaluated 132 times by 1 test |
| 0-132 |
1571 | (string[i])TRUE | never evaluated | FALSE | evaluated 132 times by 1 test |
| 0-132 |
1572 | ))) TRUE | never evaluated | FALSE | evaluated 132 times by 1 test |
| 0-132 |
1573 | != (char *)TRUE | never evaluated | FALSE | evaluated 132 times by 1 test |
| 0-132 |
1574 | ((void *)0)TRUE | never evaluated | FALSE | evaluated 132 times by 1 test |
| 0-132 |
1575 | ) : 0)TRUE | never evaluated | FALSE | evaluated 132 times by 1 test |
) | 0-132 |
1576 | { | - |
1577 | i++; | - |
1578 | return never executed: return i; i;never executed: return i; | 0 |
1579 | } | - |
1580 | | - |
1581 | if ((1 && | - |
1582 | ((*TRUE | evaluated 2 times by 1 test | FALSE | evaluated 130 times by 1 test |
__ctype_b_loc ())[(int) ((TRUE | evaluated 2 times by 1 test | FALSE | evaluated 130 times by 1 test |
| 2-130 |
1583 | (unsigned char)string[i]TRUE | evaluated 2 times by 1 test | FALSE | evaluated 130 times by 1 test |
| 2-130 |
1584 | ))] & (unsigned short int) _ISdigit)TRUE | evaluated 2 times by 1 test | FALSE | evaluated 130 times by 1 test |
| 2-130 |
1585 | )) | - |
1586 | { | - |
1587 | j = i; | - |
1588 | while (string[j]TRUE | evaluated 4 times by 1 test | FALSE | never evaluated |
&& (1 && | 0-4 |
1589 | ((*TRUE | evaluated 2 times by 1 test | FALSE | evaluated 2 times by 1 test |
__ctype_b_loc ())[(int) ((TRUE | evaluated 2 times by 1 test | FALSE | evaluated 2 times by 1 test |
| 2 |
1590 | (unsigned char)string[j]TRUE | evaluated 2 times by 1 test | FALSE | evaluated 2 times by 1 test |
| 2 |
1591 | ))] & (unsigned short int) _ISdigit)TRUE | evaluated 2 times by 1 test | FALSE | evaluated 2 times by 1 test |
| 2 |
1592 | )) | - |
1593 | j++;executed 2 times by 1 test: j++; | 2 |
1594 | if (string[j] == 0TRUE | never evaluated | FALSE | evaluated 2 times by 1 test |
) | 0-2 |
1595 | return never executed: return (j); (j);never executed: return (j); | 0 |
1596 | if (string[j] == '<'TRUE | never evaluated | FALSE | evaluated 2 times by 1 test |
|| string[j] == '>'TRUE | evaluated 2 times by 1 test | FALSE | never evaluated |
) | 0-2 |
1597 | i = j;executed 2 times by 1 test: i = j; | 2 |
1598 | else | - |
1599 | { | - |
1600 | i = j; | - |
1601 | goto never executed: goto get_word; get_word;never executed: goto get_word; | 0 |
1602 | } | - |
1603 | } | - |
1604 | | - |
1605 | if (((TRUE | evaluated 132 times by 1 test | FALSE | never evaluated |
TRUE | evaluated 5 times by 1 test | FALSE | evaluated 127 times by 1 test |
TRUE | evaluated 132 times by 1 test | FALSE | never evaluated |
string[i])TRUE | evaluated 5 times by 1 test | FALSE | evaluated 127 times by 1 test |
TRUE | evaluated 132 times by 1 test | FALSE | never evaluated |
? ((char *)TRUE | evaluated 5 times by 1 test | FALSE | evaluated 127 times by 1 test |
| 0-132 |
1606 | (__extension__ (__builtin_constant_p (TRUE | evaluated 5 times by 1 test | FALSE | evaluated 127 times by 1 test |
| 5-127 |
1607 | (string[i])TRUE | evaluated 5 times by 1 test | FALSE | evaluated 127 times by 1 test |
| 5-127 |
1608 | ) && !__builtin_constant_p (TRUE | evaluated 5 times by 1 test | FALSE | evaluated 127 times by 1 test |
| 5-127 |
1609 | ("<>;&|$")TRUE | evaluated 5 times by 1 test | FALSE | evaluated 127 times by 1 test |
| 5-127 |
1610 | ) && (TRUE | evaluated 5 times by 1 test | FALSE | evaluated 127 times by 1 test |
| 5-127 |
1611 | (string[i])TRUE | evaluated 5 times by 1 test | FALSE | evaluated 127 times by 1 test |
| 5-127 |
1612 | ) == '\0' ? (char *) __rawmemchr (TRUE | evaluated 5 times by 1 test | FALSE | evaluated 127 times by 1 test |
| 5-127 |
1613 | ("<>;&|$")TRUE | evaluated 5 times by 1 test | FALSE | evaluated 127 times by 1 test |
| 5-127 |
1614 | , TRUE | evaluated 5 times by 1 test | FALSE | evaluated 127 times by 1 test |
| 5-127 |
1615 | (string[i])TRUE | evaluated 5 times by 1 test | FALSE | evaluated 127 times by 1 test |
| 5-127 |
1616 | ) : __builtin_strchr (TRUE | evaluated 5 times by 1 test | FALSE | evaluated 127 times by 1 test |
| 5-127 |
1617 | ("<>;&|$")TRUE | evaluated 5 times by 1 test | FALSE | evaluated 127 times by 1 test |
| 5-127 |
1618 | , TRUE | evaluated 5 times by 1 test | FALSE | evaluated 127 times by 1 test |
| 5-127 |
1619 | (string[i])TRUE | evaluated 5 times by 1 test | FALSE | evaluated 127 times by 1 test |
| 5-127 |
1620 | ))) TRUE | evaluated 5 times by 1 test | FALSE | evaluated 127 times by 1 test |
| 5-127 |
1621 | != (char *)TRUE | evaluated 5 times by 1 test | FALSE | evaluated 127 times by 1 test |
| 5-127 |
1622 | ((void *)0)TRUE | evaluated 5 times by 1 test | FALSE | evaluated 127 times by 1 test |
| 5-127 |
1623 | ) : 0)TRUE | evaluated 5 times by 1 test | FALSE | evaluated 127 times by 1 test |
) | 5-127 |
1624 | { | - |
1625 | int peek = string[i + 1]; | - |
1626 | | - |
1627 | if (peek == string[i]TRUE | never evaluated | FALSE | evaluated 5 times by 1 test |
&& peek != '$'TRUE | never evaluated | FALSE | never evaluated |
) | 0-5 |
1628 | { | - |
1629 | if (peek == '<'TRUE | never evaluated | FALSE | never evaluated |
&& string[i + 2] == '-'TRUE | never evaluated | FALSE | never evaluated |
) | 0 |
1630 | i++; never executed: i++; | 0 |
1631 | else if (peek == '<'TRUE | never evaluated | FALSE | never evaluated |
&& string[i + 2] == '<'TRUE | never evaluated | FALSE | never evaluated |
) | 0 |
1632 | i++; never executed: i++; | 0 |
1633 | i += 2; | - |
1634 | return never executed: return i; i;never executed: return i; | 0 |
1635 | } | - |
1636 | else if (peek == '&'TRUE | never evaluated | FALSE | evaluated 5 times by 1 test |
&& (string[i] == '>'TRUE | never evaluated | FALSE | never evaluated |
|| string[i] == '<'TRUE | never evaluated | FALSE | never evaluated |
)) | 0-5 |
1637 | { | - |
1638 | j = i + 2; | - |
1639 | while (string[j]TRUE | never evaluated | FALSE | never evaluated |
&& (1 && | 0 |
1640 | ((*TRUE | never evaluated | FALSE | never evaluated |
__ctype_b_loc ())[(int) ((TRUE | never evaluated | FALSE | never evaluated |
| 0 |
1641 | (unsigned char)string[j]TRUE | never evaluated | FALSE | never evaluated |
| 0 |
1642 | ))] & (unsigned short int) _ISdigit)TRUE | never evaluated | FALSE | never evaluated |
| 0 |
1643 | )) | - |
1644 | j++; never executed: j++; | 0 |
1645 | if (string[j] =='-'TRUE | never evaluated | FALSE | never evaluated |
) | 0 |
1646 | j++; never executed: j++; | 0 |
1647 | return never executed: return j; j;never executed: return j; | 0 |
1648 | } | - |
1649 | else if ((peek == '>'TRUE | never evaluated | FALSE | evaluated 5 times by 1 test |
&& string[i] == '&'TRUE | never evaluated | FALSE | never evaluated |
) || (peek == '|'TRUE | never evaluated | FALSE | evaluated 5 times by 1 test |
&& string[i] == '>'TRUE | never evaluated | FALSE | never evaluated |
)) | 0-5 |
1650 | { | - |
1651 | i += 2; | - |
1652 | return never executed: return i; i;never executed: return i; | 0 |
1653 | } | - |
1654 | | - |
1655 | else if ((peek == '('TRUE | never evaluated | FALSE | evaluated 5 times by 1 test |
&& (string[i] == '>'TRUE | never evaluated | FALSE | never evaluated |
|| string[i] == '<'TRUE | never evaluated | FALSE | never evaluated |
)) || | 0-5 |
1656 | (peek == '('TRUE | never evaluated | FALSE | evaluated 5 times by 1 test |
&& string[i] == '$'TRUE | never evaluated | FALSE | never evaluated |
)) | 0-5 |
1657 | { | - |
1658 | i += 2; | - |
1659 | delimopen = '('; | - |
1660 | delimiter = ')'; | - |
1661 | nestdelim = 1; | - |
1662 | goto never executed: goto get_word; get_word;never executed: goto get_word; | 0 |
1663 | } | - |
1664 | if (string[i] != '$'TRUE | evaluated 2 times by 1 test | FALSE | evaluated 3 times by 1 test |
) | 2-3 |
1665 | { | - |
1666 | i++; | - |
1667 | returnexecuted 2 times by 1 test: return i; i;executed 2 times by 1 test: return i; | 2 |
1668 | } | - |
1669 | }executed 3 times by 1 test: end of block | 3 |
1670 | | - |
1671 | | - |
1672 | if (((TRUE | evaluated 130 times by 1 test | FALSE | never evaluated |
string[i])TRUE | evaluated 130 times by 1 test | FALSE | never evaluated |
? ((char *)TRUE | never evaluated | FALSE | evaluated 130 times by 1 test |
| 0-130 |
1673 | (__extension__ (__builtin_constant_p (TRUE | never evaluated | FALSE | evaluated 130 times by 1 test |
| 0-130 |
1674 | (string[i])TRUE | never evaluated | FALSE | evaluated 130 times by 1 test |
| 0-130 |
1675 | ) && !__builtin_constant_p (TRUE | never evaluated | FALSE | evaluated 130 times by 1 test |
| 0-130 |
1676 | ("!@?+*")TRUE | never evaluated | FALSE | evaluated 130 times by 1 test |
| 0-130 |
1677 | ) && (TRUE | never evaluated | FALSE | evaluated 130 times by 1 test |
| 0-130 |
1678 | (string[i])TRUE | never evaluated | FALSE | evaluated 130 times by 1 test |
| 0-130 |
1679 | ) == '\0' ? (char *) __rawmemchr (TRUE | never evaluated | FALSE | evaluated 130 times by 1 test |
| 0-130 |
1680 | ("!@?+*")TRUE | never evaluated | FALSE | evaluated 130 times by 1 test |
| 0-130 |
1681 | , TRUE | never evaluated | FALSE | evaluated 130 times by 1 test |
| 0-130 |
1682 | (string[i])TRUE | never evaluated | FALSE | evaluated 130 times by 1 test |
| 0-130 |
1683 | ) : __builtin_strchr (TRUE | never evaluated | FALSE | evaluated 130 times by 1 test |
| 0-130 |
1684 | ("!@?+*")TRUE | never evaluated | FALSE | evaluated 130 times by 1 test |
| 0-130 |
1685 | , TRUE | never evaluated | FALSE | evaluated 130 times by 1 test |
| 0-130 |
1686 | (string[i])TRUE | never evaluated | FALSE | evaluated 130 times by 1 test |
| 0-130 |
1687 | ))) TRUE | never evaluated | FALSE | evaluated 130 times by 1 test |
| 0-130 |
1688 | != (char *)TRUE | never evaluated | FALSE | evaluated 130 times by 1 test |
| 0-130 |
1689 | ((void *)0)TRUE | never evaluated | FALSE | evaluated 130 times by 1 test |
| 0-130 |
1690 | ) : 0)TRUE | never evaluated | FALSE | evaluated 130 times by 1 test |
) | 0-130 |
1691 | { | - |
1692 | int peek = string[i + 1]; | - |
1693 | | - |
1694 | if (peek == '('TRUE | never evaluated | FALSE | never evaluated |
) | 0 |
1695 | { | - |
1696 | | - |
1697 | i += 2; | - |
1698 | delimopen = '('; | - |
1699 | delimiter = ')'; | - |
1700 | nestdelim = 1; | - |
1701 | } never executed: end of block | 0 |
1702 | } never executed: end of block | 0 |
1703 | | - |
1704 | get_word:code before this statement executed 130 times by 1 test: get_word: | 130 |
1705 | | - |
1706 | | - |
1707 | if (delimiter == 0TRUE | evaluated 130 times by 1 test | FALSE | never evaluated |
&& ((TRUE | evaluated 130 times by 1 test | FALSE | never evaluated |
TRUE | evaluated 5 times by 1 test | FALSE | evaluated 125 times by 1 test |
string[i])TRUE | evaluated 130 times by 1 test | FALSE | never evaluated |
? ((char *)TRUE | evaluated 5 times by 1 test | FALSE | evaluated 125 times by 1 test |
| 0-130 |
1708 | (__extension__ (__builtin_constant_p (TRUE | evaluated 5 times by 1 test | FALSE | evaluated 125 times by 1 test |
| 5-125 |
1709 | (string[i])TRUE | evaluated 5 times by 1 test | FALSE | evaluated 125 times by 1 test |
| 5-125 |
1710 | ) && !__builtin_constant_p (TRUE | evaluated 5 times by 1 test | FALSE | evaluated 125 times by 1 test |
| 5-125 |
1711 | ("\"'`")TRUE | evaluated 5 times by 1 test | FALSE | evaluated 125 times by 1 test |
| 5-125 |
1712 | ) && (TRUE | evaluated 5 times by 1 test | FALSE | evaluated 125 times by 1 test |
| 5-125 |
1713 | (string[i])TRUE | evaluated 5 times by 1 test | FALSE | evaluated 125 times by 1 test |
| 5-125 |
1714 | ) == '\0' ? (char *) __rawmemchr (TRUE | evaluated 5 times by 1 test | FALSE | evaluated 125 times by 1 test |
| 5-125 |
1715 | ("\"'`")TRUE | evaluated 5 times by 1 test | FALSE | evaluated 125 times by 1 test |
| 5-125 |
1716 | , TRUE | evaluated 5 times by 1 test | FALSE | evaluated 125 times by 1 test |
| 5-125 |
1717 | (string[i])TRUE | evaluated 5 times by 1 test | FALSE | evaluated 125 times by 1 test |
| 5-125 |
1718 | ) : __builtin_strchr (TRUE | evaluated 5 times by 1 test | FALSE | evaluated 125 times by 1 test |
| 5-125 |
1719 | ("\"'`")TRUE | evaluated 5 times by 1 test | FALSE | evaluated 125 times by 1 test |
| 5-125 |
1720 | , TRUE | evaluated 5 times by 1 test | FALSE | evaluated 125 times by 1 test |
| 5-125 |
1721 | (string[i])TRUE | evaluated 5 times by 1 test | FALSE | evaluated 125 times by 1 test |
| 5-125 |
1722 | ))) TRUE | evaluated 5 times by 1 test | FALSE | evaluated 125 times by 1 test |
| 5-125 |
1723 | != (char *)TRUE | evaluated 5 times by 1 test | FALSE | evaluated 125 times by 1 test |
| 5-125 |
1724 | ((void *)0)TRUE | evaluated 5 times by 1 test | FALSE | evaluated 125 times by 1 test |
| 5-125 |
1725 | ) : 0)TRUE | evaluated 5 times by 1 test | FALSE | evaluated 125 times by 1 test |
) | 5-125 |
1726 | delimiter = string[i++];executed 5 times by 1 test: delimiter = string[i++]; | 5 |
1727 | | - |
1728 | for (; string[i]TRUE | evaluated 529 times by 1 test | FALSE | evaluated 31 times by 1 test |
; i++) | 31-529 |
1729 | { | - |
1730 | if (string[i] == '\\'TRUE | evaluated 2 times by 1 test | FALSE | evaluated 527 times by 1 test |
&& string[i + 1] == '\n'TRUE | never evaluated | FALSE | evaluated 2 times by 1 test |
) | 0-527 |
1731 | { | - |
1732 | i++; | - |
1733 | continue; never executed: continue; | 0 |
1734 | } | - |
1735 | | - |
1736 | if (string[i] == '\\'TRUE | evaluated 2 times by 1 test | FALSE | evaluated 527 times by 1 test |
&& delimiter != '\''TRUE | evaluated 2 times by 1 test | FALSE | never evaluated |
&& | 0-527 |
1737 | (delimiter != '"'TRUE | evaluated 2 times by 1 test | FALSE | never evaluated |
|| ((TRUE | never evaluated | FALSE | never evaluated |
string[i]) ? ((char *)TRUE | never evaluated | FALSE | never evaluated |
| 0-2 |
1738 | (__extension__ (__builtin_constant_p (TRUE | never evaluated | FALSE | never evaluated |
| 0 |
1739 | (string[i])TRUE | never evaluated | FALSE | never evaluated |
| 0 |
1740 | ) && !__builtin_constant_p (TRUE | never evaluated | FALSE | never evaluated |
| 0 |
1741 | ("\\`\"$")TRUE | never evaluated | FALSE | never evaluated |
| 0 |
1742 | ) && (TRUE | never evaluated | FALSE | never evaluated |
| 0 |
1743 | (string[i])TRUE | never evaluated | FALSE | never evaluated |
| 0 |
1744 | ) == '\0' ? (char *) __rawmemchr (TRUE | never evaluated | FALSE | never evaluated |
| 0 |
1745 | ("\\`\"$")TRUE | never evaluated | FALSE | never evaluated |
| 0 |
1746 | , TRUE | never evaluated | FALSE | never evaluated |
| 0 |
1747 | (string[i])TRUE | never evaluated | FALSE | never evaluated |
| 0 |
1748 | ) : __builtin_strchr (TRUE | never evaluated | FALSE | never evaluated |
| 0 |
1749 | ("\\`\"$")TRUE | never evaluated | FALSE | never evaluated |
| 0 |
1750 | , TRUE | never evaluated | FALSE | never evaluated |
| 0 |
1751 | (string[i])TRUE | never evaluated | FALSE | never evaluated |
| 0 |
1752 | ))) TRUE | never evaluated | FALSE | never evaluated |
| 0 |
1753 | != (char *)TRUE | never evaluated | FALSE | never evaluated |
| 0 |
1754 | ((void *)0)TRUE | never evaluated | FALSE | never evaluated |
| 0 |
1755 | ) : 0)TRUE | never evaluated | FALSE | never evaluated |
)) | 0 |
1756 | { | - |
1757 | i++; | - |
1758 | continue;executed 2 times by 1 test: continue; | 2 |
1759 | } | - |
1760 | | - |
1761 | | - |
1762 | | - |
1763 | if (nestdelimTRUE | never evaluated | FALSE | evaluated 527 times by 1 test |
&& string[i] == delimopenTRUE | never evaluated | FALSE | never evaluated |
) | 0-527 |
1764 | { | - |
1765 | nestdelim++; | - |
1766 | continue; never executed: continue; | 0 |
1767 | } | - |
1768 | if (nestdelimTRUE | never evaluated | FALSE | evaluated 527 times by 1 test |
&& string[i] == delimiterTRUE | never evaluated | FALSE | never evaluated |
) | 0-527 |
1769 | { | - |
1770 | nestdelim--; | - |
1771 | if (nestdelim == 0TRUE | never evaluated | FALSE | never evaluated |
) | 0 |
1772 | delimiter = 0; never executed: delimiter = 0; | 0 |
1773 | continue; never executed: continue; | 0 |
1774 | } | - |
1775 | | - |
1776 | if (delimiterTRUE | evaluated 54 times by 1 test | FALSE | evaluated 473 times by 1 test |
&& string[i] == delimiterTRUE | evaluated 5 times by 1 test | FALSE | evaluated 49 times by 1 test |
) | 5-473 |
1777 | { | - |
1778 | delimiter = 0; | - |
1779 | continue;executed 5 times by 1 test: continue; | 5 |
1780 | } | - |
1781 | | - |
1782 | if (delimiter == 0TRUE | evaluated 473 times by 1 test | FALSE | evaluated 49 times by 1 test |
&& (((TRUE | evaluated 473 times by 1 test | FALSE | never evaluated |
TRUE | evaluated 99 times by 1 test | FALSE | evaluated 374 times by 1 test |
string[i])TRUE | evaluated 473 times by 1 test | FALSE | never evaluated |
? ((char *)TRUE | evaluated 99 times by 1 test | FALSE | evaluated 374 times by 1 test |
| 0-473 |
1783 | (__extension__ (__builtin_constant_p (TRUE | evaluated 99 times by 1 test | FALSE | evaluated 374 times by 1 test |
| 99-374 |
1784 | (string[i])TRUE | evaluated 99 times by 1 test | FALSE | evaluated 374 times by 1 test |
| 99-374 |
1785 | ) && !__builtin_constant_p (TRUE | evaluated 99 times by 1 test | FALSE | evaluated 374 times by 1 test |
| 99-374 |
1786 | (history_word_delimiters)TRUE | evaluated 99 times by 1 test | FALSE | evaluated 374 times by 1 test |
| 99-374 |
1787 | ) && (TRUE | evaluated 99 times by 1 test | FALSE | evaluated 374 times by 1 test |
| 99-374 |
1788 | (string[i])TRUE | evaluated 99 times by 1 test | FALSE | evaluated 374 times by 1 test |
| 99-374 |
1789 | ) == '\0' ? (char *) __rawmemchr (TRUE | evaluated 99 times by 1 test | FALSE | evaluated 374 times by 1 test |
| 99-374 |
1790 | (history_word_delimiters)TRUE | evaluated 99 times by 1 test | FALSE | evaluated 374 times by 1 test |
| 99-374 |
1791 | , TRUE | evaluated 99 times by 1 test | FALSE | evaluated 374 times by 1 test |
| 99-374 |
1792 | (string[i])TRUE | evaluated 99 times by 1 test | FALSE | evaluated 374 times by 1 test |
| 99-374 |
1793 | ) : __builtin_strchr (TRUE | evaluated 99 times by 1 test | FALSE | evaluated 374 times by 1 test |
| 99-374 |
1794 | (history_word_delimiters)TRUE | evaluated 99 times by 1 test | FALSE | evaluated 374 times by 1 test |
| 99-374 |
1795 | , TRUE | evaluated 99 times by 1 test | FALSE | evaluated 374 times by 1 test |
| 99-374 |
1796 | (string[i])TRUE | evaluated 99 times by 1 test | FALSE | evaluated 374 times by 1 test |
| 99-374 |
1797 | ))) TRUE | evaluated 99 times by 1 test | FALSE | evaluated 374 times by 1 test |
| 99-374 |
1798 | != (char *)TRUE | evaluated 99 times by 1 test | FALSE | evaluated 374 times by 1 test |
| 99-374 |
1799 | ((void *)0)TRUE | evaluated 99 times by 1 test | FALSE | evaluated 374 times by 1 test |
| 99-374 |
1800 | ) : 0))TRUE | evaluated 99 times by 1 test | FALSE | evaluated 374 times by 1 test |
) | 99-374 |
1801 | break;executed 99 times by 1 test: break; | 99 |
1802 | | - |
1803 | if (delimiter == 0TRUE | evaluated 374 times by 1 test | FALSE | evaluated 49 times by 1 test |
&& ((TRUE | never evaluated | FALSE | evaluated 374 times by 1 test |
string[i]) ? ((char *)TRUE | never evaluated | FALSE | evaluated 374 times by 1 test |
| 0-374 |
1804 | (__extension__ (__builtin_constant_p (TRUE | never evaluated | FALSE | evaluated 374 times by 1 test |
| 0-374 |
1805 | (string[i])TRUE | never evaluated | FALSE | evaluated 374 times by 1 test |
| 0-374 |
1806 | ) && !__builtin_constant_p (TRUE | never evaluated | FALSE | evaluated 374 times by 1 test |
| 0-374 |
1807 | ("\"'`")TRUE | never evaluated | FALSE | evaluated 374 times by 1 test |
| 0-374 |
1808 | ) && (TRUE | never evaluated | FALSE | evaluated 374 times by 1 test |
| 0-374 |
1809 | (string[i])TRUE | never evaluated | FALSE | evaluated 374 times by 1 test |
| 0-374 |
1810 | ) == '\0' ? (char *) __rawmemchr (TRUE | never evaluated | FALSE | evaluated 374 times by 1 test |
| 0-374 |
1811 | ("\"'`")TRUE | never evaluated | FALSE | evaluated 374 times by 1 test |
| 0-374 |
1812 | , TRUE | never evaluated | FALSE | evaluated 374 times by 1 test |
| 0-374 |
1813 | (string[i])TRUE | never evaluated | FALSE | evaluated 374 times by 1 test |
| 0-374 |
1814 | ) : __builtin_strchr (TRUE | never evaluated | FALSE | evaluated 374 times by 1 test |
| 0-374 |
1815 | ("\"'`")TRUE | never evaluated | FALSE | evaluated 374 times by 1 test |
| 0-374 |
1816 | , TRUE | never evaluated | FALSE | evaluated 374 times by 1 test |
| 0-374 |
1817 | (string[i])TRUE | never evaluated | FALSE | evaluated 374 times by 1 test |
| 0-374 |
1818 | ))) TRUE | never evaluated | FALSE | evaluated 374 times by 1 test |
| 0-374 |
1819 | != (char *)TRUE | never evaluated | FALSE | evaluated 374 times by 1 test |
| 0-374 |
1820 | ((void *)0)TRUE | never evaluated | FALSE | evaluated 374 times by 1 test |
| 0-374 |
1821 | ) : 0)TRUE | never evaluated | FALSE | evaluated 374 times by 1 test |
) | 0-374 |
1822 | delimiter = string[i]; never executed: delimiter = string[i]; | 0 |
1823 | }executed 423 times by 1 test: end of block | 423 |
1824 | | - |
1825 | returnexecuted 130 times by 1 test: return i; i;executed 130 times by 1 test: return i; | 130 |
1826 | } | - |
1827 | | - |
1828 | static char * | - |
1829 | history_substring (const char *string, int start, int end) | - |
1830 | { | - |
1831 | register int len; | - |
1832 | register char *result; | - |
1833 | | - |
1834 | len = end - start; | - |
1835 | result = (char *)xmalloc (len + 1); | - |
1836 | | - |
1837 | __builtin_strncpy ( | - |
1838 | result | - |
1839 | , | - |
1840 | string + start | - |
1841 | , | - |
1842 | len | - |
1843 | ) | - |
1844 | ; | - |
1845 | result[len] = '\0'; | - |
1846 | returnexecuted 132 times by 1 test: return result; result;executed 132 times by 1 test: return result; | 132 |
1847 | } | - |
1848 | | - |
1849 | | - |
1850 | | - |
1851 | | - |
1852 | | - |
1853 | static char ** | - |
1854 | history_tokenize_internal (const char *string, int wind, int *indp) | - |
1855 | { | - |
1856 | char **result; | - |
1857 | register int i, start, result_index, size; | - |
1858 | | - |
1859 | | - |
1860 | | - |
1861 | if (indpTRUE | evaluated 5 times by 1 test | FALSE | evaluated 26 times by 1 test |
&& wind != -1TRUE | evaluated 5 times by 1 test | FALSE | never evaluated |
) | 0-26 |
1862 | *executed 5 times by 1 test: *indp = -1; indp = -1;executed 5 times by 1 test: *indp = -1; | 5 |
1863 | | - |
1864 | | - |
1865 | | - |
1866 | for (i = result_index = size = 0, result = (char **) | - |
1867 | ((void *)0) | - |
1868 | ; string[i]TRUE | evaluated 132 times by 1 test | FALSE | evaluated 31 times by 1 test |
; ) | 31-132 |
1869 | { | - |
1870 | | - |
1871 | for (; string[i]TRUE | evaluated 231 times by 1 test | FALSE | never evaluated |
&& (((TRUE | evaluated 99 times by 1 test | FALSE | evaluated 132 times by 1 test |
string[i]) == ' ')TRUE | evaluated 99 times by 1 test | FALSE | evaluated 132 times by 1 test |
|| ((TRUE | never evaluated | FALSE | evaluated 132 times by 1 test |
string[i]) == '\t')TRUE | never evaluated | FALSE | evaluated 132 times by 1 test |
); i++) | 0-231 |
1872 | ;executed 99 times by 1 test: ; | 99 |
1873 | if (string[i] == 0TRUE | never evaluated | FALSE | evaluated 132 times by 1 test |
|| string[i] == history_comment_charTRUE | never evaluated | FALSE | evaluated 132 times by 1 test |
) | 0-132 |
1874 | return never executed: return (result); (result);never executed: return (result); | 0 |
1875 | | - |
1876 | start = i; | - |
1877 | | - |
1878 | i = history_tokenize_word (string, start); | - |
1879 | | - |
1880 | | - |
1881 | | - |
1882 | | - |
1883 | | - |
1884 | if (i == startTRUE | never evaluated | FALSE | evaluated 132 times by 1 test |
&& history_word_delimitersTRUE | never evaluated | FALSE | never evaluated |
) | 0-132 |
1885 | { | - |
1886 | i++; | - |
1887 | while (string[i]TRUE | never evaluated | FALSE | never evaluated |
&& ((TRUE | never evaluated | FALSE | never evaluated |
string[i]) ? ((char *)TRUE | never evaluated | FALSE | never evaluated |
| 0 |
1888 | (__extension__ (__builtin_constant_p (TRUE | never evaluated | FALSE | never evaluated |
| 0 |
1889 | (string[i])TRUE | never evaluated | FALSE | never evaluated |
| 0 |
1890 | ) && !__builtin_constant_p (TRUE | never evaluated | FALSE | never evaluated |
| 0 |
1891 | (history_word_delimiters)TRUE | never evaluated | FALSE | never evaluated |
| 0 |
1892 | ) && (TRUE | never evaluated | FALSE | never evaluated |
| 0 |
1893 | (string[i])TRUE | never evaluated | FALSE | never evaluated |
| 0 |
1894 | ) == '\0' ? (char *) __rawmemchr (TRUE | never evaluated | FALSE | never evaluated |
| 0 |
1895 | (history_word_delimiters)TRUE | never evaluated | FALSE | never evaluated |
| 0 |
1896 | , TRUE | never evaluated | FALSE | never evaluated |
| 0 |
1897 | (string[i])TRUE | never evaluated | FALSE | never evaluated |
| 0 |
1898 | ) : __builtin_strchr (TRUE | never evaluated | FALSE | never evaluated |
| 0 |
1899 | (history_word_delimiters)TRUE | never evaluated | FALSE | never evaluated |
| 0 |
1900 | , TRUE | never evaluated | FALSE | never evaluated |
| 0 |
1901 | (string[i])TRUE | never evaluated | FALSE | never evaluated |
| 0 |
1902 | ))) TRUE | never evaluated | FALSE | never evaluated |
| 0 |
1903 | != (char *)TRUE | never evaluated | FALSE | never evaluated |
| 0 |
1904 | ((void *)0)TRUE | never evaluated | FALSE | never evaluated |
| 0 |
1905 | ) : 0)TRUE | never evaluated | FALSE | never evaluated |
) | 0 |
1906 | i++; never executed: i++; | 0 |
1907 | } never executed: end of block | 0 |
1908 | | - |
1909 | | - |
1910 | | - |
1911 | if (indpTRUE | evaluated 28 times by 1 test | FALSE | evaluated 104 times by 1 test |
&& wind != -1TRUE | evaluated 28 times by 1 test | FALSE | never evaluated |
&& wind >= startTRUE | evaluated 16 times by 1 test | FALSE | evaluated 12 times by 1 test |
&& wind < iTRUE | evaluated 5 times by 1 test | FALSE | evaluated 11 times by 1 test |
) | 0-104 |
1912 | *executed 5 times by 1 test: *indp = result_index; indp = result_index;executed 5 times by 1 test: *indp = result_index; | 5 |
1913 | | - |
1914 | if (result_index + 2 >= sizeTRUE | evaluated 31 times by 1 test | FALSE | evaluated 101 times by 1 test |
) | 31-101 |
1915 | result = (char **)xrealloc (result, ((size += 10) * sizeof (char *)));executed 31 times by 1 test: result = (char **)xrealloc (result, ((size += 10) * sizeof (char *))); | 31 |
1916 | | - |
1917 | result[result_index++] = history_substring (string, start, i); | - |
1918 | result[result_index] = (char *) | - |
1919 | ((void *)0) | - |
1920 | ; | - |
1921 | }executed 132 times by 1 test: end of block | 132 |
1922 | | - |
1923 | returnexecuted 31 times by 1 test: return (result); (result);executed 31 times by 1 test: return (result); | 31 |
1924 | } | - |
1925 | | - |
1926 | | - |
1927 | | - |
1928 | char ** | - |
1929 | history_tokenize (const char *string) | - |
1930 | { | - |
1931 | returnexecuted 26 times by 1 test: return (history_tokenize_internal (string, -1, (int *) ((void *)0) )); (history_tokenize_internal (string, -1, (int *)executed 26 times by 1 test: return (history_tokenize_internal (string, -1, (int *) ((void *)0) )); | 26 |
1932 | ((void *)0)executed 26 times by 1 test: return (history_tokenize_internal (string, -1, (int *) ((void *)0) )); | 26 |
1933 | ));executed 26 times by 1 test: return (history_tokenize_internal (string, -1, (int *) ((void *)0) )); | 26 |
1934 | } | - |
1935 | | - |
1936 | | - |
1937 | static void | - |
1938 | freewords (char **words, int start) | - |
1939 | { | - |
1940 | register int i; | - |
1941 | | - |
1942 | for (i = start; words[i]TRUE | evaluated 12 times by 1 test | FALSE | evaluated 5 times by 1 test |
; i++) | 5-12 |
1943 | xfree (words[i]);executed 12 times by 1 test: xfree (words[i]); | 12 |
1944 | }executed 5 times by 1 test: end of block | 5 |
1945 | | - |
1946 | | - |
1947 | | - |
1948 | | - |
1949 | static char * | - |
1950 | history_find_word (char *line, int ind) | - |
1951 | { | - |
1952 | char **words, *s; | - |
1953 | int i, wind; | - |
1954 | | - |
1955 | words = history_tokenize_internal (line, ind, &wind); | - |
1956 | if (wind == -1TRUE | never evaluated | FALSE | evaluated 5 times by 1 test |
|| words == 0TRUE | never evaluated | FALSE | evaluated 5 times by 1 test |
) | 0-5 |
1957 | { | - |
1958 | if (wordsTRUE | never evaluated | FALSE | never evaluated |
) | 0 |
1959 | freewords (words, 0); never executed: freewords (words, 0); | 0 |
1960 | if (wordsTRUE | never evaluated | FALSE | never evaluated |
) free (words);never executed: free (words); | 0 |
1961 | return never executed: return ((char *) ((void *)0) ); ((char *)never executed: return ((char *) ((void *)0) ); | 0 |
1962 | ((void *)0) never executed: return ((char *) ((void *)0) ); | 0 |
1963 | ); never executed: return ((char *) ((void *)0) ); | 0 |
1964 | } | - |
1965 | s = words[wind]; | - |
1966 | for (i = 0; i < windTRUE | evaluated 11 times by 1 test | FALSE | evaluated 5 times by 1 test |
; i++) | 5-11 |
1967 | xfree (words[i]);executed 11 times by 1 test: xfree (words[i]); | 11 |
1968 | freewords (words, wind + 1); | - |
1969 | xfree (words); | - |
1970 | returnexecuted 5 times by 1 test: return s; s;executed 5 times by 1 test: return s; | 5 |
1971 | } | - |
| | |