Line | Source | Count |
1 | | - |
2 | | - |
3 | | - |
4 | static struct field_range_pair *current_rp; | - |
5 | static char *field_1_buffer; | - |
6 | | - |
7 | | - |
8 | static size_t field_1_bufsize; | - |
9 | | - |
10 | enum operating_mode | - |
11 | { | - |
12 | undefined_mode, | - |
13 | | - |
14 | | - |
15 | byte_mode, | - |
16 | | - |
17 | | - |
18 | field_mode | - |
19 | }; | - |
20 | | - |
21 | static enum operating_mode operating_mode; | - |
22 | | - |
23 | | - |
24 | | - |
25 | | - |
26 | static | - |
27 | _Bool | - |
28 | suppress_non_delimited; | - |
29 | | - |
30 | | - |
31 | | - |
32 | static | - |
33 | _Bool | - |
34 | complement; | - |
35 | | - |
36 | | - |
37 | static unsigned char delim; | - |
38 | | - |
39 | | - |
40 | static unsigned char line_delim = '\n'; | - |
41 | | - |
42 | | - |
43 | static | - |
44 | _Bool | - |
45 | output_delimiter_specified; | - |
46 | | - |
47 | | - |
48 | static size_t output_delimiter_length; | - |
49 | | - |
50 | | - |
51 | | - |
52 | static char *output_delimiter_string; | - |
53 | | - |
54 | | - |
55 | static | - |
56 | _Bool | - |
57 | have_read_stdin; | - |
58 | | - |
59 | | - |
60 | | - |
61 | enum | - |
62 | { | - |
63 | OUTPUT_DELIMITER_OPTION = 0x7f + 1, | - |
64 | COMPLEMENT_OPTION | - |
65 | }; | - |
66 | | - |
67 | static struct option const longopts[] = | - |
68 | { | - |
69 | {"bytes", | - |
70 | 1 | - |
71 | , | - |
72 | ((void *)0) | - |
73 | , 'b'}, | - |
74 | {"characters", | - |
75 | 1 | - |
76 | , | - |
77 | ((void *)0) | - |
78 | , 'c'}, | - |
79 | {"fields", | - |
80 | 1 | - |
81 | , | - |
82 | ((void *)0) | - |
83 | , 'f'}, | - |
84 | {"delimiter", | - |
85 | 1 | - |
86 | , | - |
87 | ((void *)0) | - |
88 | , 'd'}, | - |
89 | {"only-delimited", | - |
90 | 0 | - |
91 | , | - |
92 | ((void *)0) | - |
93 | , 's'}, | - |
94 | {"output-delimiter", | - |
95 | 1 | - |
96 | , | - |
97 | ((void *)0) | - |
98 | , OUTPUT_DELIMITER_OPTION}, | - |
99 | {"complement", | - |
100 | 0 | - |
101 | , | - |
102 | ((void *)0) | - |
103 | , COMPLEMENT_OPTION}, | - |
104 | {"zero-terminated", | - |
105 | 0 | - |
106 | , | - |
107 | ((void *)0) | - |
108 | , 'z'}, | - |
109 | {"help", | - |
110 | 0 | - |
111 | , | - |
112 | ((void *)0) | - |
113 | , GETOPT_HELP_CHAR}, | - |
114 | {"version", | - |
115 | 0 | - |
116 | , | - |
117 | ((void *)0) | - |
118 | , GETOPT_VERSION_CHAR}, | - |
119 | { | - |
120 | ((void *)0) | - |
121 | , 0, | - |
122 | ((void *)0) | - |
123 | , 0} | - |
124 | }; | - |
125 | | - |
126 | void | - |
127 | usage (int status) | - |
128 | { | - |
129 | if (status != TRUE | evaluated 46 times by 1 test | FALSE | evaluated 2 times by 1 test |
| 2-46 |
130 | 0TRUE | evaluated 46 times by 1 test | FALSE | evaluated 2 times by 1 test |
| 2-46 |
131 | ) | - |
132 | do { fprintf ( | - |
133 | stderr | - |
134 | , | - |
135 | dcgettext (((void *)0), | - |
136 | "Try '%s --help' for more information.\n" | - |
137 | , 5) | - |
138 | , program_name); }executed 46 times by 1 test: end of block while (0); | 46 |
139 | else | - |
140 | { | - |
141 | printf ( | - |
142 | dcgettext (((void *)0), | - |
143 | "Usage: %s OPTION... [FILE]...\n" | - |
144 | , 5) | - |
145 | | - |
146 | | - |
147 | , | - |
148 | program_name); | - |
149 | fputs_unlocked ( | - |
150 | dcgettext (((void *)0), | - |
151 | "Print selected parts of lines from each FILE to standard output.\n" | - |
152 | , 5) | - |
153 | , | - |
154 | stdout | - |
155 | ) | - |
156 | | - |
157 | ; | - |
158 | | - |
159 | emit_stdin_note (); | - |
160 | emit_mandatory_arg_note (); | - |
161 | | - |
162 | fputs_unlocked ( | - |
163 | dcgettext (((void *)0), | - |
164 | " -b, --bytes=LIST select only these bytes\n -c, --characters=LIST select only these characters\n -d, --delimiter=DELIM use DELIM instead of TAB for field delimiter\n" | - |
165 | , 5) | - |
166 | , | - |
167 | stdout | - |
168 | ) | - |
169 | | - |
170 | | - |
171 | | - |
172 | ; | - |
173 | fputs_unlocked ( | - |
174 | dcgettext (((void *)0), | - |
175 | " -f, --fields=LIST select only these fields; also print any line\n that contains no delimiter character, unless\n the -s option is specified\n -n (ignored)\n" | - |
176 | , 5) | - |
177 | , | - |
178 | stdout | - |
179 | ) | - |
180 | | - |
181 | | - |
182 | | - |
183 | | - |
184 | ; | - |
185 | fputs_unlocked ( | - |
186 | dcgettext (((void *)0), | - |
187 | " --complement complement the set of selected bytes, characters\n or fields\n" | - |
188 | , 5) | - |
189 | , | - |
190 | stdout | - |
191 | ) | - |
192 | | - |
193 | | - |
194 | ; | - |
195 | fputs_unlocked ( | - |
196 | dcgettext (((void *)0), | - |
197 | " -s, --only-delimited do not print lines not containing delimiters\n --output-delimiter=STRING use STRING as the output delimiter\n the default is to use the input delimiter\n" | - |
198 | , 5) | - |
199 | , | - |
200 | stdout | - |
201 | ) | - |
202 | | - |
203 | | - |
204 | | - |
205 | ; | - |
206 | fputs_unlocked ( | - |
207 | dcgettext (((void *)0), | - |
208 | " -z, --zero-terminated line delimiter is NUL, not newline\n" | - |
209 | , 5) | - |
210 | , | - |
211 | stdout | - |
212 | ) | - |
213 | | - |
214 | ; | - |
215 | fputs_unlocked ( | - |
216 | dcgettext (((void *)0), | - |
217 | " --help display this help and exit\n" | - |
218 | , 5) | - |
219 | , | - |
220 | stdout | - |
221 | ); | - |
222 | fputs_unlocked ( | - |
223 | dcgettext (((void *)0), | - |
224 | " --version output version information and exit\n" | - |
225 | , 5) | - |
226 | , | - |
227 | stdout | - |
228 | ); | - |
229 | fputs_unlocked ( | - |
230 | dcgettext (((void *)0), | - |
231 | "\nUse one, and only one of -b, -c or -f. Each LIST is made up of one\nrange, or many ranges separated by commas. Selected input is written\nin the same order that it is read, and is written exactly once.\n" | - |
232 | , 5) | - |
233 | , | - |
234 | stdout | - |
235 | ) | - |
236 | | - |
237 | | - |
238 | | - |
239 | | - |
240 | ; | - |
241 | fputs_unlocked ( | - |
242 | dcgettext (((void *)0), | - |
243 | "Each range is one of:\n\n N N'th byte, character or field, counted from 1\n N- from N'th byte, character or field, to end of line\n N-M from N'th to M'th (included) byte, character or field\n -M from first to M'th (included) byte, character or field\n" | - |
244 | , 5) | - |
245 | , | - |
246 | stdout | - |
247 | ) | - |
248 | | - |
249 | | - |
250 | | - |
251 | | - |
252 | | - |
253 | | - |
254 | ; | - |
255 | emit_ancillary_info ("cut"); | - |
256 | }executed 2 times by 1 test: end of block | 2 |
257 | exit (status);executed 48 times by 1 test: exit (status); | 48 |
258 | } | - |
259 | | - |
260 | | - |
261 | | - |
262 | | - |
263 | | - |
264 | static inline void | - |
265 | next_item (uintmax_t *item_idx) | - |
266 | { | - |
267 | (*item_idx)++; | - |
268 | if ((*TRUE | evaluated 168 times by 1 test | FALSE | evaluated 549 times by 1 test |
item_idx) > current_rp->hiTRUE | evaluated 168 times by 1 test | FALSE | evaluated 549 times by 1 test |
) | 168-549 |
269 | current_rp++;executed 168 times by 1 test: current_rp++; | 168 |
270 | }executed 717 times by 1 test: end of block | 717 |
271 | | - |
272 | | - |
273 | | - |
274 | static inline | - |
275 | _Bool | - |
276 | | - |
277 | print_kth (uintmax_t k) | - |
278 | { | - |
279 | returnexecuted 1166 times by 1 test: return current_rp->lo <= k; current_rp->lo <= k;executed 1166 times by 1 test: return current_rp->lo <= k; | 1166 |
280 | } | - |
281 | | - |
282 | | - |
283 | | - |
284 | static inline | - |
285 | _Bool | - |
286 | | - |
287 | is_range_start_index (uintmax_t k) | - |
288 | { | - |
289 | returnexecuted 171 times by 1 test: return k == current_rp->lo; k == current_rp->lo;executed 171 times by 1 test: return k == current_rp->lo; | 171 |
290 | } | - |
291 | | - |
292 | | - |
293 | | - |
294 | static void | - |
295 | cut_bytes (FILE *stream) | - |
296 | { | - |
297 | uintmax_t byte_idx; | - |
298 | | - |
299 | | - |
300 | | - |
301 | _Bool | - |
302 | print_delimiter; | - |
303 | | - |
304 | byte_idx = 0; | - |
305 | print_delimiter = | - |
306 | 0 | - |
307 | ; | - |
308 | current_rp = frp; | - |
309 | while ( | - |
310 | 1 | - |
311 | ) | - |
312 | { | - |
313 | int c; | - |
314 | | - |
315 | c = getc_unlocked (stream); | - |
316 | | - |
317 | if (c == line_delimTRUE | evaluated 72 times by 1 test | FALSE | evaluated 471 times by 1 test |
) | 72-471 |
318 | { | - |
319 | putchar_unlocked (c); | - |
320 | byte_idx = 0; | - |
321 | print_delimiter = | - |
322 | 0 | - |
323 | ; | - |
324 | current_rp = frp; | - |
325 | }executed 72 times by 1 test: end of block | 72 |
326 | else if (c == TRUE | evaluated 96 times by 1 test | FALSE | evaluated 375 times by 1 test |
| 96-375 |
327 | (-1)TRUE | evaluated 96 times by 1 test | FALSE | evaluated 375 times by 1 test |
| 96-375 |
328 | ) | - |
329 | { | - |
330 | if (byte_idx > 0TRUE | evaluated 12 times by 1 test | FALSE | evaluated 84 times by 1 test |
) | 12-84 |
331 | putchar_unlocked (line_delim);executed 12 times by 1 test: putchar_unlocked (line_delim); | 12 |
332 | break;executed 96 times by 1 test: break; | 96 |
333 | } | - |
334 | else | - |
335 | { | - |
336 | next_item (&byte_idx); | - |
337 | if (print_kth (byte_idx)TRUE | evaluated 255 times by 1 test | FALSE | evaluated 120 times by 1 test |
) | 120-255 |
338 | { | - |
339 | if (output_delimiter_specifiedTRUE | evaluated 222 times by 1 test | FALSE | evaluated 33 times by 1 test |
) | 33-222 |
340 | { | - |
341 | if (print_delimiterTRUE | evaluated 171 times by 1 test | FALSE | evaluated 51 times by 1 test |
&& is_range_start_index (byte_idx)TRUE | evaluated 24 times by 1 test | FALSE | evaluated 147 times by 1 test |
) | 24-171 |
342 | { | - |
343 | | - |
344 | (__extension__ ((__builtin_constant_p ( | - |
345 | sizeof (char) | - |
346 | ) && __builtin_constant_p ( | - |
347 | output_delimiter_length | - |
348 | ) && (size_t) ( | - |
349 | sizeof (char) | - |
350 | ) * (size_t) ( | - |
351 | output_delimiter_length | - |
352 | ) <= 8 && (size_t) ( | - |
353 | sizeof (char) | - |
354 | ) != 0) ? ({ const char *__ptr = (const char *) ( | - |
355 | output_delimiter_string | - |
356 | ); FILE *__stream = (stdout); size_t __cnt; for (__cnt = (size_t) ( | - |
357 | sizeof (char) | - |
358 | ) * (size_t) ( | - |
359 | output_delimiter_length | - |
360 | ); __cnt > 0TRUE | never evaluated | FALSE | never evaluated |
; --__cnt) if ((TRUE | never evaluated | FALSE | never evaluated |
__builtin_expect (((__stream)->_IO_write_ptr >= (__stream)->_IO_write_end), 0)TRUE | never evaluated | FALSE | never evaluated |
? __overflow (__stream, (unsigned char) (*__ptr++)) : (unsigned char) (*(__stream)->_IO_write_ptr++ = (*__ptr++))) == (-1)TRUE | never evaluated | FALSE | never evaluated |
) break;never executed: break; ((size_t) ( | 0 |
361 | sizeof (char) | - |
362 | ) * (size_t) ( | - |
363 | output_delimiter_length | - |
364 | ) - __cnt) / (size_t) ( | - |
365 | sizeof (char) | - |
366 | ); }) : (((__builtin_constant_p ( | - |
367 | sizeof (char) | - |
368 | ) && (size_t) ( | - |
369 | sizeof (char) | - |
370 | ) == 0) || (__builtin_constant_p ( | - |
371 | output_delimiter_length | - |
372 | ) && (size_t) ( | - |
373 | output_delimiter_length | - |
374 | ) == 0)) ? ((void) ( | - |
375 | output_delimiter_string | - |
376 | ), (void) (stdout), (void) ( | - |
377 | sizeof (char) | - |
378 | ), (void) ( | - |
379 | output_delimiter_length | - |
380 | ), (size_t) 0) : fwrite_unlocked ( | - |
381 | output_delimiter_string | - |
382 | , | - |
383 | sizeof (char) | - |
384 | , | - |
385 | output_delimiter_length | - |
386 | , stdout)))) | - |
387 | | - |
388 | ; | - |
389 | }executed 24 times by 1 test: end of block | 24 |
390 | print_delimiter = | - |
391 | 1 | - |
392 | ; | - |
393 | }executed 222 times by 1 test: end of block | 222 |
394 | | - |
395 | putchar_unlocked (c); | - |
396 | }executed 255 times by 1 test: end of block | 255 |
397 | }executed 375 times by 1 test: end of block | 375 |
398 | } | - |
399 | }executed 96 times by 1 test: end of block | 96 |
400 | | - |
401 | | - |
402 | | - |
403 | static void | - |
404 | cut_fields (FILE *stream) | - |
405 | { | - |
406 | int c; | - |
407 | uintmax_t field_idx = 1; | - |
408 | | - |
409 | _Bool | - |
410 | found_any_selected_field = | - |
411 | 0 | - |
412 | ; | - |
413 | | - |
414 | _Bool | - |
415 | buffer_first_field; | - |
416 | | - |
417 | current_rp = frp; | - |
418 | | - |
419 | c = getc_unlocked (stream); | - |
420 | if (c == TRUE | evaluated 24 times by 1 test | FALSE | evaluated 174 times by 1 test |
| 24-174 |
421 | (-1)TRUE | evaluated 24 times by 1 test | FALSE | evaluated 174 times by 1 test |
| 24-174 |
422 | ) | - |
423 | return;executed 24 times by 1 test: return; | 24 |
424 | | - |
425 | ungetc (c, stream); | - |
426 | c = 0; | - |
427 | | - |
428 | | - |
429 | | - |
430 | | - |
431 | | - |
432 | | - |
433 | | - |
434 | buffer_first_field = (suppress_non_delimited ^ !print_kth (1)); | - |
435 | | - |
436 | while (1) | - |
437 | { | - |
438 | if (field_idx == 1TRUE | evaluated 339 times by 1 test | FALSE | evaluated 240 times by 1 test |
&& buffer_first_fieldTRUE | evaluated 166 times by 1 test | FALSE | evaluated 173 times by 1 test |
) | 166-339 |
439 | { | - |
440 | ssize_t len; | - |
441 | size_t n_bytes; | - |
442 | | - |
443 | len = getndelim2 (&field_1_buffer, &field_1_bufsize, 0, | - |
444 | ((size_t) -1), delim, line_delim, stream); | - |
445 | if (len < 0TRUE | evaluated 56 times by 1 test | FALSE | evaluated 110 times by 1 test |
) | 56-110 |
446 | { | - |
447 | free (field_1_buffer); | - |
448 | field_1_buffer = | - |
449 | ((void *)0) | - |
450 | ; | - |
451 | if (ferror_unlocked (stream)TRUE | never evaluated | FALSE | evaluated 56 times by 1 test |
|| feof_unlocked (stream)TRUE | evaluated 56 times by 1 test | FALSE | never evaluated |
) | 0-56 |
452 | break;executed 56 times by 1 test: break; | 56 |
453 | xalloc_die (); | - |
454 | } never executed: end of block | 0 |
455 | | - |
456 | n_bytes = len; | - |
457 | | - |
458 | (( | - |
459 | n_bytes != 0 | - |
460 | ) ? (void) (0) : __assert_fail ( | - |
461 | "n_bytes != 0" | - |
462 | , "src/cut.c", 329, __PRETTY_FUNCTION__)) | - |
463 | ; | - |
464 | | - |
465 | c = 0; | - |
466 | | - |
467 | | - |
468 | | - |
469 | | - |
470 | if (to_uchar (field_1_buffer[n_bytes - 1]) != delimTRUE | evaluated 8 times by 1 test | FALSE | evaluated 102 times by 1 test |
) | 8-102 |
471 | { | - |
472 | if (suppress_non_delimitedTRUE | evaluated 6 times by 1 test | FALSE | evaluated 2 times by 1 test |
) | 2-6 |
473 | { | - |
474 | | - |
475 | }executed 6 times by 1 test: end of block | 6 |
476 | else | - |
477 | { | - |
478 | | - |
479 | (__extension__ ((__builtin_constant_p ( | - |
480 | sizeof (char) | - |
481 | ) && __builtin_constant_p ( | - |
482 | n_bytes | - |
483 | ) && (size_t) ( | - |
484 | sizeof (char) | - |
485 | ) * (size_t) ( | - |
486 | n_bytes | - |
487 | ) <= 8 && (size_t) ( | - |
488 | sizeof (char) | - |
489 | ) != 0) ? ({ const char *__ptr = (const char *) ( | - |
490 | field_1_buffer | - |
491 | ); FILE *__stream = (stdout); size_t __cnt; for (__cnt = (size_t) ( | - |
492 | sizeof (char) | - |
493 | ) * (size_t) ( | - |
494 | n_bytes | - |
495 | ); __cnt > 0TRUE | never evaluated | FALSE | never evaluated |
; --__cnt) if ((TRUE | never evaluated | FALSE | never evaluated |
__builtin_expect (((__stream)->_IO_write_ptr >= (__stream)->_IO_write_end), 0)TRUE | never evaluated | FALSE | never evaluated |
? __overflow (__stream, (unsigned char) (*__ptr++)) : (unsigned char) (*(__stream)->_IO_write_ptr++ = (*__ptr++))) == (-1)TRUE | never evaluated | FALSE | never evaluated |
) break;never executed: break; ((size_t) ( | 0 |
496 | sizeof (char) | - |
497 | ) * (size_t) ( | - |
498 | n_bytes | - |
499 | ) - __cnt) / (size_t) ( | - |
500 | sizeof (char) | - |
501 | ); }) : (((__builtin_constant_p ( | - |
502 | sizeof (char) | - |
503 | ) && (size_t) ( | - |
504 | sizeof (char) | - |
505 | ) == 0) || (__builtin_constant_p ( | - |
506 | n_bytes | - |
507 | ) && (size_t) ( | - |
508 | n_bytes | - |
509 | ) == 0)) ? ((void) ( | - |
510 | field_1_buffer | - |
511 | ), (void) (stdout), (void) ( | - |
512 | sizeof (char) | - |
513 | ), (void) ( | - |
514 | n_bytes | - |
515 | ), (size_t) 0) : fwrite_unlocked ( | - |
516 | field_1_buffer | - |
517 | , | - |
518 | sizeof (char) | - |
519 | , | - |
520 | n_bytes | - |
521 | , stdout)))) | - |
522 | ; | - |
523 | | - |
524 | if (field_1_buffer[n_bytes - 1] != line_delimTRUE | evaluated 2 times by 1 test | FALSE | never evaluated |
) | 0-2 |
525 | putchar_unlocked (line_delim);executed 2 times by 1 test: putchar_unlocked (line_delim); | 2 |
526 | c = line_delim; | - |
527 | }executed 2 times by 1 test: end of block | 2 |
528 | continue;executed 8 times by 1 test: continue; | 8 |
529 | } | - |
530 | if (print_kth (1)TRUE | evaluated 60 times by 1 test | FALSE | evaluated 42 times by 1 test |
) | 42-60 |
531 | { | - |
532 | | - |
533 | | - |
534 | (__extension__ ((__builtin_constant_p ( | - |
535 | sizeof (char) | - |
536 | ) && __builtin_constant_p ( | - |
537 | n_bytes - 1 | - |
538 | ) && (size_t) ( | - |
539 | sizeof (char) | - |
540 | ) * (size_t) ( | - |
541 | n_bytes - 1 | - |
542 | ) <= 8 && (size_t) ( | - |
543 | sizeof (char) | - |
544 | ) != 0) ? ({ const char *__ptr = (const char *) ( | - |
545 | field_1_buffer | - |
546 | ); FILE *__stream = (stdout); size_t __cnt; for (__cnt = (size_t) ( | - |
547 | sizeof (char) | - |
548 | ) * (size_t) ( | - |
549 | n_bytes - 1 | - |
550 | ); __cnt > 0TRUE | never evaluated | FALSE | never evaluated |
; --__cnt) if ((TRUE | never evaluated | FALSE | never evaluated |
__builtin_expect (((__stream)->_IO_write_ptr >= (__stream)->_IO_write_end), 0)TRUE | never evaluated | FALSE | never evaluated |
? __overflow (__stream, (unsigned char) (*__ptr++)) : (unsigned char) (*(__stream)->_IO_write_ptr++ = (*__ptr++))) == (-1)TRUE | never evaluated | FALSE | never evaluated |
) break;never executed: break; ((size_t) ( | 0 |
551 | sizeof (char) | - |
552 | ) * (size_t) ( | - |
553 | n_bytes - 1 | - |
554 | ) - __cnt) / (size_t) ( | - |
555 | sizeof (char) | - |
556 | ); }) : (((__builtin_constant_p ( | - |
557 | sizeof (char) | - |
558 | ) && (size_t) ( | - |
559 | sizeof (char) | - |
560 | ) == 0) || (__builtin_constant_p ( | - |
561 | n_bytes - 1 | - |
562 | ) && (size_t) ( | - |
563 | n_bytes - 1 | - |
564 | ) == 0)) ? ((void) ( | - |
565 | field_1_buffer | - |
566 | ), (void) (stdout), (void) ( | - |
567 | sizeof (char) | - |
568 | ), (void) ( | - |
569 | n_bytes - 1 | - |
570 | ), (size_t) 0) : fwrite_unlocked ( | - |
571 | field_1_buffer | - |
572 | , | - |
573 | sizeof (char) | - |
574 | , | - |
575 | n_bytes - 1 | - |
576 | , stdout)))) | - |
577 | ; | - |
578 | | - |
579 | | - |
580 | if (delim == line_delimTRUE | evaluated 12 times by 1 test | FALSE | evaluated 48 times by 1 test |
) | 12-48 |
581 | { | - |
582 | int last_c = getc_unlocked (stream); | - |
583 | if (last_c != TRUE | evaluated 9 times by 1 test | FALSE | evaluated 3 times by 1 test |
| 3-9 |
584 | (-1)TRUE | evaluated 9 times by 1 test | FALSE | evaluated 3 times by 1 test |
| 3-9 |
585 | ) | - |
586 | { | - |
587 | ungetc (last_c, stream); | - |
588 | found_any_selected_field = | - |
589 | 1 | - |
590 | ; | - |
591 | }executed 9 times by 1 test: end of block | 9 |
592 | }executed 12 times by 1 test: end of block | 12 |
593 | else | - |
594 | found_any_selected_field = executed 48 times by 1 test: found_any_selected_field = 1 ; | 48 |
595 | 1executed 48 times by 1 test: found_any_selected_field = 1 ; | 48 |
596 | ;executed 48 times by 1 test: found_any_selected_field = 1 ; | 48 |
597 | } | - |
598 | next_item (&field_idx); | - |
599 | }executed 102 times by 1 test: end of block | 102 |
600 | | - |
601 | int prev_c = c; | - |
602 | | - |
603 | if (print_kth (field_idx)TRUE | evaluated 329 times by 1 test | FALSE | evaluated 186 times by 1 test |
) | 186-329 |
604 | { | - |
605 | if (found_any_selected_fieldTRUE | evaluated 156 times by 1 test | FALSE | evaluated 173 times by 1 test |
) | 156-173 |
606 | { | - |
607 | | - |
608 | (__extension__ ((__builtin_constant_p ( | - |
609 | sizeof (char) | - |
610 | ) && __builtin_constant_p ( | - |
611 | output_delimiter_length | - |
612 | ) && (size_t) ( | - |
613 | sizeof (char) | - |
614 | ) * (size_t) ( | - |
615 | output_delimiter_length | - |
616 | ) <= 8 && (size_t) ( | - |
617 | sizeof (char) | - |
618 | ) != 0) ? ({ const char *__ptr = (const char *) ( | - |
619 | output_delimiter_string | - |
620 | ); FILE *__stream = (stdout); size_t __cnt; for (__cnt = (size_t) ( | - |
621 | sizeof (char) | - |
622 | ) * (size_t) ( | - |
623 | output_delimiter_length | - |
624 | ); __cnt > 0TRUE | never evaluated | FALSE | never evaluated |
; --__cnt) if ((TRUE | never evaluated | FALSE | never evaluated |
__builtin_expect (((__stream)->_IO_write_ptr >= (__stream)->_IO_write_end), 0)TRUE | never evaluated | FALSE | never evaluated |
? __overflow (__stream, (unsigned char) (*__ptr++)) : (unsigned char) (*(__stream)->_IO_write_ptr++ = (*__ptr++))) == (-1)TRUE | never evaluated | FALSE | never evaluated |
) break;never executed: break; ((size_t) ( | 0 |
625 | sizeof (char) | - |
626 | ) * (size_t) ( | - |
627 | output_delimiter_length | - |
628 | ) - __cnt) / (size_t) ( | - |
629 | sizeof (char) | - |
630 | ); }) : (((__builtin_constant_p ( | - |
631 | sizeof (char) | - |
632 | ) && (size_t) ( | - |
633 | sizeof (char) | - |
634 | ) == 0) || (__builtin_constant_p ( | - |
635 | output_delimiter_length | - |
636 | ) && (size_t) ( | - |
637 | output_delimiter_length | - |
638 | ) == 0)) ? ((void) ( | - |
639 | output_delimiter_string | - |
640 | ), (void) (stdout), (void) ( | - |
641 | sizeof (char) | - |
642 | ), (void) ( | - |
643 | output_delimiter_length | - |
644 | ), (size_t) 0) : fwrite_unlocked ( | - |
645 | output_delimiter_string | - |
646 | , | - |
647 | sizeof (char) | - |
648 | , | - |
649 | output_delimiter_length | - |
650 | , stdout)))) | - |
651 | | - |
652 | ; | - |
653 | }executed 156 times by 1 test: end of block | 156 |
654 | found_any_selected_field = | - |
655 | 1 | - |
656 | ; | - |
657 | | - |
658 | while ((TRUE | evaluated 355 times by 1 test | FALSE | evaluated 174 times by 1 test |
c = getc_unlocked (stream)) != delimTRUE | evaluated 355 times by 1 test | FALSE | evaluated 174 times by 1 test |
&& c != line_delimTRUE | evaluated 249 times by 1 test | FALSE | evaluated 106 times by 1 test |
&& c != TRUE | evaluated 200 times by 1 test | FALSE | evaluated 49 times by 1 test |
| 49-355 |
659 | (-1)TRUE | evaluated 200 times by 1 test | FALSE | evaluated 49 times by 1 test |
| 49-200 |
660 | ) | - |
661 | { | - |
662 | putchar_unlocked (c); | - |
663 | prev_c = c; | - |
664 | }executed 200 times by 1 test: end of block | 200 |
665 | }executed 329 times by 1 test: end of block | 329 |
666 | else | - |
667 | { | - |
668 | while ((TRUE | evaluated 422 times by 1 test | FALSE | evaluated 75 times by 1 test |
c = getc_unlocked (stream)) != delimTRUE | evaluated 422 times by 1 test | FALSE | evaluated 75 times by 1 test |
&& c != line_delimTRUE | evaluated 371 times by 1 test | FALSE | evaluated 51 times by 1 test |
&& c != TRUE | evaluated 311 times by 1 test | FALSE | evaluated 60 times by 1 test |
| 51-422 |
669 | (-1)TRUE | evaluated 311 times by 1 test | FALSE | evaluated 60 times by 1 test |
| 60-311 |
670 | ) | - |
671 | { | - |
672 | prev_c = c; | - |
673 | }executed 311 times by 1 test: end of block | 311 |
674 | }executed 186 times by 1 test: end of block | 186 |
675 | | - |
676 | | - |
677 | if (delim == line_delimTRUE | evaluated 57 times by 1 test | FALSE | evaluated 458 times by 1 test |
&& c == delimTRUE | evaluated 30 times by 1 test | FALSE | evaluated 27 times by 1 test |
) | 27-458 |
678 | { | - |
679 | int last_c = getc_unlocked (stream); | - |
680 | if (last_c != TRUE | evaluated 21 times by 1 test | FALSE | evaluated 9 times by 1 test |
| 9-21 |
681 | (-1)TRUE | evaluated 21 times by 1 test | FALSE | evaluated 9 times by 1 test |
| 9-21 |
682 | ) | - |
683 | ungetc (last_c, stream);executed 21 times by 1 test: ungetc (last_c, stream); | 21 |
684 | else | - |
685 | c = last_c;executed 9 times by 1 test: c = last_c; | 9 |
686 | } | - |
687 | | - |
688 | if (c == delimTRUE | evaluated 240 times by 1 test | FALSE | evaluated 275 times by 1 test |
) | 240-275 |
689 | next_item (&field_idx);executed 240 times by 1 test: next_item (&field_idx); | 240 |
690 | else if (c == line_delimTRUE | evaluated 157 times by 1 test | FALSE | evaluated 118 times by 1 test |
|| c == TRUE | evaluated 118 times by 1 test | FALSE | never evaluated |
| 0-157 |
691 | (-1)TRUE | evaluated 118 times by 1 test | FALSE | never evaluated |
| 0-118 |
692 | ) | - |
693 | { | - |
694 | if (found_any_selected_fieldTRUE | evaluated 230 times by 1 test | FALSE | evaluated 45 times by 1 test |
| 45-230 |
695 | || !(suppress_non_delimitedTRUE | evaluated 42 times by 1 test | FALSE | evaluated 3 times by 1 test |
&& field_idx == 1TRUE | evaluated 39 times by 1 test | FALSE | evaluated 3 times by 1 test |
)) | 3-42 |
696 | { | - |
697 | if (c == line_delimTRUE | evaluated 154 times by 1 test | FALSE | evaluated 82 times by 1 test |
|| prev_c != line_delimTRUE | evaluated 63 times by 1 test | FALSE | evaluated 19 times by 1 test |
| 19-154 |
698 | || delim == line_delimTRUE | never evaluated | FALSE | evaluated 19 times by 1 test |
) | 0-19 |
699 | putchar_unlocked (line_delim);executed 217 times by 1 test: putchar_unlocked (line_delim); | 217 |
700 | }executed 236 times by 1 test: end of block | 236 |
701 | if (c == TRUE | evaluated 118 times by 1 test | FALSE | evaluated 157 times by 1 test |
| 118-157 |
702 | (-1)TRUE | evaluated 118 times by 1 test | FALSE | evaluated 157 times by 1 test |
| 118-157 |
703 | ) | - |
704 | break;executed 118 times by 1 test: break; | 118 |
705 | field_idx = 1; | - |
706 | current_rp = frp; | - |
707 | found_any_selected_field = | - |
708 | 0 | - |
709 | ; | - |
710 | }executed 157 times by 1 test: end of block | 157 |
711 | }executed 397 times by 1 test: end of block | 397 |
712 | }executed 174 times by 1 test: end of block | 174 |
713 | | - |
714 | static void | - |
715 | cut_stream (FILE *stream) | - |
716 | { | - |
717 | if (operating_mode == byte_modeTRUE | evaluated 96 times by 1 test | FALSE | evaluated 198 times by 1 test |
) | 96-198 |
718 | cut_bytes (stream);executed 96 times by 1 test: cut_bytes (stream); | 96 |
719 | else | - |
720 | cut_fields (stream);executed 198 times by 1 test: cut_fields (stream); | 198 |
721 | } | - |
722 | | - |
723 | | - |
724 | | - |
725 | | - |
726 | static | - |
727 | _Bool | - |
728 | | - |
729 | cut_file (char const *file) | - |
730 | { | - |
731 | FILE *stream; | - |
732 | | - |
733 | if ((TRUE | evaluated 192 times by 1 test | FALSE | evaluated 102 times by 1 test |
| 102-192 |
734 | __extension__ ({ size_t __s1_len, __s2_len; (__builtin_constant_p (TRUE | evaluated 192 times by 1 test | FALSE | evaluated 102 times by 1 test |
| 102-192 |
735 | fileTRUE | evaluated 192 times by 1 test | FALSE | evaluated 102 times by 1 test |
| 102-192 |
736 | ) && __builtin_constant_p (TRUE | evaluated 192 times by 1 test | FALSE | evaluated 102 times by 1 test |
| 102-192 |
737 | "-"TRUE | evaluated 192 times by 1 test | FALSE | evaluated 102 times by 1 test |
| 102-192 |
738 | ) && (__s1_len = __builtin_strlen (TRUE | evaluated 192 times by 1 test | FALSE | evaluated 102 times by 1 test |
| 102-192 |
739 | fileTRUE | evaluated 192 times by 1 test | FALSE | evaluated 102 times by 1 test |
| 102-192 |
740 | ), __s2_len = __builtin_strlen (TRUE | evaluated 192 times by 1 test | FALSE | evaluated 102 times by 1 test |
| 102-192 |
741 | "-"TRUE | evaluated 192 times by 1 test | FALSE | evaluated 102 times by 1 test |
| 102-192 |
742 | ), (!((size_t)(const void *)((TRUE | evaluated 192 times by 1 test | FALSE | evaluated 102 times by 1 test |
| 102-192 |
743 | fileTRUE | evaluated 192 times by 1 test | FALSE | evaluated 102 times by 1 test |
| 102-192 |
744 | ) + 1) - (size_t)(const void *)(TRUE | evaluated 192 times by 1 test | FALSE | evaluated 102 times by 1 test |
| 102-192 |
745 | fileTRUE | evaluated 192 times by 1 test | FALSE | evaluated 102 times by 1 test |
| 102-192 |
746 | ) == 1) || __s1_len >= 4) && (!((size_t)(const void *)((TRUE | evaluated 192 times by 1 test | FALSE | evaluated 102 times by 1 test |
| 102-192 |
747 | "-"TRUE | evaluated 192 times by 1 test | FALSE | evaluated 102 times by 1 test |
| 102-192 |
748 | ) + 1) - (size_t)(const void *)(TRUE | evaluated 192 times by 1 test | FALSE | evaluated 102 times by 1 test |
| 102-192 |
749 | "-"TRUE | evaluated 192 times by 1 test | FALSE | evaluated 102 times by 1 test |
| 102-192 |
750 | ) == 1) || __s2_len >= 4)) ? __builtin_strcmp (TRUE | evaluated 192 times by 1 test | FALSE | evaluated 102 times by 1 test |
| 102-192 |
751 | fileTRUE | evaluated 192 times by 1 test | FALSE | evaluated 102 times by 1 test |
| 102-192 |
752 | , TRUE | evaluated 192 times by 1 test | FALSE | evaluated 102 times by 1 test |
| 102-192 |
753 | "-"TRUE | evaluated 192 times by 1 test | FALSE | evaluated 102 times by 1 test |
| 102-192 |
754 | ) : (__builtin_constant_p (TRUE | evaluated 192 times by 1 test | FALSE | evaluated 102 times by 1 test |
| 102-192 |
755 | fileTRUE | evaluated 192 times by 1 test | FALSE | evaluated 102 times by 1 test |
| 102-192 |
756 | ) && ((size_t)(const void *)((TRUE | evaluated 192 times by 1 test | FALSE | evaluated 102 times by 1 test |
| 102-192 |
757 | fileTRUE | evaluated 192 times by 1 test | FALSE | evaluated 102 times by 1 test |
| 102-192 |
758 | ) + 1) - (size_t)(const void *)(TRUE | evaluated 192 times by 1 test | FALSE | evaluated 102 times by 1 test |
| 102-192 |
759 | fileTRUE | evaluated 192 times by 1 test | FALSE | evaluated 102 times by 1 test |
| 102-192 |
760 | ) == 1) && (__s1_len = __builtin_strlen (TRUE | evaluated 192 times by 1 test | FALSE | evaluated 102 times by 1 test |
| 102-192 |
761 | fileTRUE | evaluated 192 times by 1 test | FALSE | evaluated 102 times by 1 test |
| 102-192 |
762 | ), __s1_len < 4) ? (__builtin_constant_p (TRUE | evaluated 192 times by 1 test | FALSE | evaluated 102 times by 1 test |
| 102-192 |
763 | "-"TRUE | evaluated 192 times by 1 test | FALSE | evaluated 102 times by 1 test |
| 102-192 |
764 | ) && ((size_t)(const void *)((TRUE | evaluated 192 times by 1 test | FALSE | evaluated 102 times by 1 test |
| 102-192 |
765 | "-"TRUE | evaluated 192 times by 1 test | FALSE | evaluated 102 times by 1 test |
| 102-192 |
766 | ) + 1) - (size_t)(const void *)(TRUE | evaluated 192 times by 1 test | FALSE | evaluated 102 times by 1 test |
| 102-192 |
767 | "-"TRUE | evaluated 192 times by 1 test | FALSE | evaluated 102 times by 1 test |
| 102-192 |
768 | ) == 1) ? __builtin_strcmp (TRUE | evaluated 192 times by 1 test | FALSE | evaluated 102 times by 1 test |
| 102-192 |
769 | fileTRUE | evaluated 192 times by 1 test | FALSE | evaluated 102 times by 1 test |
| 102-192 |
770 | , TRUE | evaluated 192 times by 1 test | FALSE | evaluated 102 times by 1 test |
| 102-192 |
771 | "-"TRUE | evaluated 192 times by 1 test | FALSE | evaluated 102 times by 1 test |
| 102-192 |
772 | ) : (__extension__ ({ const unsigned char *__s2 = (const unsigned char *) (const char *) (TRUE | evaluated 192 times by 1 test | FALSE | evaluated 102 times by 1 test |
| 102-192 |
773 | "-"TRUE | evaluated 192 times by 1 test | FALSE | evaluated 102 times by 1 test |
| 102-192 |
774 | ); int __result = (((const unsigned char *) (const char *) (TRUE | evaluated 192 times by 1 test | FALSE | evaluated 102 times by 1 test |
| 102-192 |
775 | fileTRUE | evaluated 192 times by 1 test | FALSE | evaluated 102 times by 1 test |
| 102-192 |
776 | ))[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 192 times by 1 test | FALSE | evaluated 102 times by 1 test |
| 0-192 |
777 | fileTRUE | evaluated 192 times by 1 test | FALSE | evaluated 102 times by 1 test |
| 102-192 |
778 | ))[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 192 times by 1 test | FALSE | evaluated 102 times by 1 test |
| 0-192 |
779 | fileTRUE | evaluated 192 times by 1 test | FALSE | evaluated 102 times by 1 test |
| 102-192 |
780 | ))[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 *) ( file ))[3] - __s2[3]); TRUE | evaluated 192 times by 1 test | FALSE | evaluated 102 times by 1 test |
| 0-192 |
781 | fileTRUE | evaluated 192 times by 1 test | FALSE | evaluated 102 times by 1 test |
never executed: __result = (((const unsigned char *) (const char *) ( file ))[3] - __s2[3]); | 0-192 |
782 | ))[3] - __s2[3]);TRUE | evaluated 192 times by 1 test | FALSE | evaluated 102 times by 1 test |
never executed: __result = (((const unsigned char *) (const char *) ( file ))[3] - __s2[3]); }never executed: end of block }never executed: end of block __result; }))) : (__builtin_constant_p (TRUE | evaluated 192 times by 1 test | FALSE | evaluated 102 times by 1 test |
| 0-192 |
783 | "-"TRUE | evaluated 192 times by 1 test | FALSE | evaluated 102 times by 1 test |
| 102-192 |
784 | ) && ((size_t)(const void *)((TRUE | evaluated 192 times by 1 test | FALSE | evaluated 102 times by 1 test |
| 102-192 |
785 | "-"TRUE | evaluated 192 times by 1 test | FALSE | evaluated 102 times by 1 test |
| 102-192 |
786 | ) + 1) - (size_t)(const void *)(TRUE | evaluated 192 times by 1 test | FALSE | evaluated 102 times by 1 test |
| 102-192 |
787 | "-"TRUE | evaluated 192 times by 1 test | FALSE | evaluated 102 times by 1 test |
| 102-192 |
788 | ) == 1) && (__s2_len = __builtin_strlen (TRUE | evaluated 192 times by 1 test | FALSE | evaluated 102 times by 1 test |
| 102-192 |
789 | "-"TRUE | evaluated 192 times by 1 test | FALSE | evaluated 102 times by 1 test |
| 102-192 |
790 | ), __s2_len < 4) ? (__builtin_constant_p (TRUE | evaluated 192 times by 1 test | FALSE | evaluated 102 times by 1 test |
| 102-192 |
791 | fileTRUE | evaluated 192 times by 1 test | FALSE | evaluated 102 times by 1 test |
| 102-192 |
792 | ) && ((size_t)(const void *)((TRUE | evaluated 192 times by 1 test | FALSE | evaluated 102 times by 1 test |
| 102-192 |
793 | fileTRUE | evaluated 192 times by 1 test | FALSE | evaluated 102 times by 1 test |
| 102-192 |
794 | ) + 1) - (size_t)(const void *)(TRUE | evaluated 192 times by 1 test | FALSE | evaluated 102 times by 1 test |
| 102-192 |
795 | fileTRUE | evaluated 192 times by 1 test | FALSE | evaluated 102 times by 1 test |
| 102-192 |
796 | ) == 1) ? __builtin_strcmp (TRUE | evaluated 192 times by 1 test | FALSE | evaluated 102 times by 1 test |
| 102-192 |
797 | fileTRUE | evaluated 192 times by 1 test | FALSE | evaluated 102 times by 1 test |
| 102-192 |
798 | , TRUE | evaluated 192 times by 1 test | FALSE | evaluated 102 times by 1 test |
| 102-192 |
799 | "-"TRUE | evaluated 192 times by 1 test | FALSE | evaluated 102 times by 1 test |
| 102-192 |
800 | ) : -(__extension__ ({ const unsigned char *__s2 = (const unsigned char *) (const char *) (TRUE | evaluated 192 times by 1 test | FALSE | evaluated 102 times by 1 test |
| 102-192 |
801 | fileTRUE | evaluated 192 times by 1 test | FALSE | evaluated 102 times by 1 test |
| 102-192 |
802 | ); int __result = (((const unsigned char *) (const char *) (TRUE | evaluated 192 times by 1 test | FALSE | evaluated 102 times by 1 test |
| 102-192 |
803 | "-"TRUE | evaluated 192 times by 1 test | FALSE | evaluated 102 times by 1 test |
| 102-192 |
804 | ))[0] - __s2[0]); if (__s2_len > 0TRUE | evaluated 294 times by 1 test | FALSE | never evaluated |
&& __result == 0TRUE | evaluated 192 times by 1 test | FALSE | evaluated 102 times by 1 test |
) { __result = (((const unsigned char *) (const char *) (TRUE | evaluated 192 times by 1 test | FALSE | evaluated 102 times by 1 test |
| 0-294 |
805 | "-"TRUE | evaluated 192 times by 1 test | FALSE | evaluated 102 times by 1 test |
| 102-192 |
806 | ))[1] - __s2[1]); if (__s2_len > 1TRUE | never evaluated | FALSE | evaluated 192 times by 1 test |
&& __result == 0TRUE | never evaluated | FALSE | never evaluated |
) { __result = (((const unsigned char *) (const char *) (TRUE | evaluated 192 times by 1 test | FALSE | evaluated 102 times by 1 test |
| 0-192 |
807 | "-"TRUE | evaluated 192 times by 1 test | FALSE | evaluated 102 times by 1 test |
| 102-192 |
808 | ))[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 *) ( "-" ))[3] - __s2[3]); TRUE | evaluated 192 times by 1 test | FALSE | evaluated 102 times by 1 test |
| 0-192 |
809 | "-"TRUE | evaluated 192 times by 1 test | FALSE | evaluated 102 times by 1 test |
never executed: __result = (((const unsigned char *) (const char *) ( "-" ))[3] - __s2[3]); | 0-192 |
810 | ))[3] - __s2[3]);TRUE | evaluated 192 times by 1 test | FALSE | evaluated 102 times by 1 test |
never executed: __result = (((const unsigned char *) (const char *) ( "-" ))[3] - __s2[3]); }never executed: end of block } __result; }))) : __builtin_strcmp (TRUE | evaluated 192 times by 1 test | FALSE | evaluated 102 times by 1 test |
| 0-192 |
811 | fileTRUE | evaluated 192 times by 1 test | FALSE | evaluated 102 times by 1 test |
| 102-192 |
812 | , TRUE | evaluated 192 times by 1 test | FALSE | evaluated 102 times by 1 test |
| 102-192 |
813 | "-"TRUE | evaluated 192 times by 1 test | FALSE | evaluated 102 times by 1 test |
| 102-192 |
814 | )))); }) TRUE | evaluated 192 times by 1 test | FALSE | evaluated 102 times by 1 test |
| 102-192 |
815 | == 0)TRUE | evaluated 192 times by 1 test | FALSE | evaluated 102 times by 1 test |
) | 102-192 |
816 | { | - |
817 | have_read_stdin = | - |
818 | 1 | - |
819 | ; | - |
820 | stream = | - |
821 | stdin | - |
822 | ; | - |
823 | }executed 192 times by 1 test: end of block | 192 |
824 | else | - |
825 | { | - |
826 | stream = fopen (file, "r"); | - |
827 | if (stream == TRUE | never evaluated | FALSE | evaluated 102 times by 1 test |
| 0-102 |
828 | ((void *)0)TRUE | never evaluated | FALSE | evaluated 102 times by 1 test |
| 0-102 |
829 | ) | - |
830 | { | - |
831 | error (0, | - |
832 | (*__errno_location ()) | - |
833 | , "%s", quotearg_n_style_colon (0, shell_escape_quoting_style, file)); | - |
834 | return never executed: return 0 ; never executed: return 0 ; | 0 |
835 | 0 never executed: return 0 ; | 0 |
836 | ; never executed: return 0 ; | 0 |
837 | } | - |
838 | }executed 102 times by 1 test: end of block | 102 |
839 | | - |
840 | fadvise (stream, FADVISE_SEQUENTIAL); | - |
841 | | - |
842 | cut_stream (stream); | - |
843 | | - |
844 | if (ferror_unlocked (stream)TRUE | never evaluated | FALSE | evaluated 294 times by 1 test |
) | 0-294 |
845 | { | - |
846 | error (0, | - |
847 | (*__errno_location ()) | - |
848 | , "%s", quotearg_n_style_colon (0, shell_escape_quoting_style, file)); | - |
849 | return never executed: return 0 ; never executed: return 0 ; | 0 |
850 | 0 never executed: return 0 ; | 0 |
851 | ; never executed: return 0 ; | 0 |
852 | } | - |
853 | if ((TRUE | evaluated 192 times by 1 test | FALSE | evaluated 102 times by 1 test |
| 102-192 |
854 | __extension__ ({ size_t __s1_len, __s2_len; (__builtin_constant_p (TRUE | evaluated 192 times by 1 test | FALSE | evaluated 102 times by 1 test |
| 102-192 |
855 | fileTRUE | evaluated 192 times by 1 test | FALSE | evaluated 102 times by 1 test |
| 102-192 |
856 | ) && __builtin_constant_p (TRUE | evaluated 192 times by 1 test | FALSE | evaluated 102 times by 1 test |
| 102-192 |
857 | "-"TRUE | evaluated 192 times by 1 test | FALSE | evaluated 102 times by 1 test |
| 102-192 |
858 | ) && (__s1_len = __builtin_strlen (TRUE | evaluated 192 times by 1 test | FALSE | evaluated 102 times by 1 test |
| 102-192 |
859 | fileTRUE | evaluated 192 times by 1 test | FALSE | evaluated 102 times by 1 test |
| 102-192 |
860 | ), __s2_len = __builtin_strlen (TRUE | evaluated 192 times by 1 test | FALSE | evaluated 102 times by 1 test |
| 102-192 |
861 | "-"TRUE | evaluated 192 times by 1 test | FALSE | evaluated 102 times by 1 test |
| 102-192 |
862 | ), (!((size_t)(const void *)((TRUE | evaluated 192 times by 1 test | FALSE | evaluated 102 times by 1 test |
| 102-192 |
863 | fileTRUE | evaluated 192 times by 1 test | FALSE | evaluated 102 times by 1 test |
| 102-192 |
864 | ) + 1) - (size_t)(const void *)(TRUE | evaluated 192 times by 1 test | FALSE | evaluated 102 times by 1 test |
| 102-192 |
865 | fileTRUE | evaluated 192 times by 1 test | FALSE | evaluated 102 times by 1 test |
| 102-192 |
866 | ) == 1) || __s1_len >= 4) && (!((size_t)(const void *)((TRUE | evaluated 192 times by 1 test | FALSE | evaluated 102 times by 1 test |
| 102-192 |
867 | "-"TRUE | evaluated 192 times by 1 test | FALSE | evaluated 102 times by 1 test |
| 102-192 |
868 | ) + 1) - (size_t)(const void *)(TRUE | evaluated 192 times by 1 test | FALSE | evaluated 102 times by 1 test |
| 102-192 |
869 | "-"TRUE | evaluated 192 times by 1 test | FALSE | evaluated 102 times by 1 test |
| 102-192 |
870 | ) == 1) || __s2_len >= 4)) ? __builtin_strcmp (TRUE | evaluated 192 times by 1 test | FALSE | evaluated 102 times by 1 test |
| 102-192 |
871 | fileTRUE | evaluated 192 times by 1 test | FALSE | evaluated 102 times by 1 test |
| 102-192 |
872 | , TRUE | evaluated 192 times by 1 test | FALSE | evaluated 102 times by 1 test |
| 102-192 |
873 | "-"TRUE | evaluated 192 times by 1 test | FALSE | evaluated 102 times by 1 test |
| 102-192 |
874 | ) : (__builtin_constant_p (TRUE | evaluated 192 times by 1 test | FALSE | evaluated 102 times by 1 test |
| 102-192 |
875 | fileTRUE | evaluated 192 times by 1 test | FALSE | evaluated 102 times by 1 test |
| 102-192 |
876 | ) && ((size_t)(const void *)((TRUE | evaluated 192 times by 1 test | FALSE | evaluated 102 times by 1 test |
| 102-192 |
877 | fileTRUE | evaluated 192 times by 1 test | FALSE | evaluated 102 times by 1 test |
| 102-192 |
878 | ) + 1) - (size_t)(const void *)(TRUE | evaluated 192 times by 1 test | FALSE | evaluated 102 times by 1 test |
| 102-192 |
879 | fileTRUE | evaluated 192 times by 1 test | FALSE | evaluated 102 times by 1 test |
| 102-192 |
880 | ) == 1) && (__s1_len = __builtin_strlen (TRUE | evaluated 192 times by 1 test | FALSE | evaluated 102 times by 1 test |
| 102-192 |
881 | fileTRUE | evaluated 192 times by 1 test | FALSE | evaluated 102 times by 1 test |
| 102-192 |
882 | ), __s1_len < 4) ? (__builtin_constant_p (TRUE | evaluated 192 times by 1 test | FALSE | evaluated 102 times by 1 test |
| 102-192 |
883 | "-"TRUE | evaluated 192 times by 1 test | FALSE | evaluated 102 times by 1 test |
| 102-192 |
884 | ) && ((size_t)(const void *)((TRUE | evaluated 192 times by 1 test | FALSE | evaluated 102 times by 1 test |
| 102-192 |
885 | "-"TRUE | evaluated 192 times by 1 test | FALSE | evaluated 102 times by 1 test |
| 102-192 |
886 | ) + 1) - (size_t)(const void *)(TRUE | evaluated 192 times by 1 test | FALSE | evaluated 102 times by 1 test |
| 102-192 |
887 | "-"TRUE | evaluated 192 times by 1 test | FALSE | evaluated 102 times by 1 test |
| 102-192 |
888 | ) == 1) ? __builtin_strcmp (TRUE | evaluated 192 times by 1 test | FALSE | evaluated 102 times by 1 test |
| 102-192 |
889 | fileTRUE | evaluated 192 times by 1 test | FALSE | evaluated 102 times by 1 test |
| 102-192 |
890 | , TRUE | evaluated 192 times by 1 test | FALSE | evaluated 102 times by 1 test |
| 102-192 |
891 | "-"TRUE | evaluated 192 times by 1 test | FALSE | evaluated 102 times by 1 test |
| 102-192 |
892 | ) : (__extension__ ({ const unsigned char *__s2 = (const unsigned char *) (const char *) (TRUE | evaluated 192 times by 1 test | FALSE | evaluated 102 times by 1 test |
| 102-192 |
893 | "-"TRUE | evaluated 192 times by 1 test | FALSE | evaluated 102 times by 1 test |
| 102-192 |
894 | ); int __result = (((const unsigned char *) (const char *) (TRUE | evaluated 192 times by 1 test | FALSE | evaluated 102 times by 1 test |
| 102-192 |
895 | fileTRUE | evaluated 192 times by 1 test | FALSE | evaluated 102 times by 1 test |
| 102-192 |
896 | ))[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 192 times by 1 test | FALSE | evaluated 102 times by 1 test |
| 0-192 |
897 | fileTRUE | evaluated 192 times by 1 test | FALSE | evaluated 102 times by 1 test |
| 102-192 |
898 | ))[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 192 times by 1 test | FALSE | evaluated 102 times by 1 test |
| 0-192 |
899 | fileTRUE | evaluated 192 times by 1 test | FALSE | evaluated 102 times by 1 test |
| 102-192 |
900 | ))[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 *) ( file ))[3] - __s2[3]); TRUE | evaluated 192 times by 1 test | FALSE | evaluated 102 times by 1 test |
| 0-192 |
901 | fileTRUE | evaluated 192 times by 1 test | FALSE | evaluated 102 times by 1 test |
never executed: __result = (((const unsigned char *) (const char *) ( file ))[3] - __s2[3]); | 0-192 |
902 | ))[3] - __s2[3]);TRUE | evaluated 192 times by 1 test | FALSE | evaluated 102 times by 1 test |
never executed: __result = (((const unsigned char *) (const char *) ( file ))[3] - __s2[3]); }never executed: end of block }never executed: end of block __result; }))) : (__builtin_constant_p (TRUE | evaluated 192 times by 1 test | FALSE | evaluated 102 times by 1 test |
| 0-192 |
903 | "-"TRUE | evaluated 192 times by 1 test | FALSE | evaluated 102 times by 1 test |
| 102-192 |
904 | ) && ((size_t)(const void *)((TRUE | evaluated 192 times by 1 test | FALSE | evaluated 102 times by 1 test |
| 102-192 |
905 | "-"TRUE | evaluated 192 times by 1 test | FALSE | evaluated 102 times by 1 test |
| 102-192 |
906 | ) + 1) - (size_t)(const void *)(TRUE | evaluated 192 times by 1 test | FALSE | evaluated 102 times by 1 test |
| 102-192 |
907 | "-"TRUE | evaluated 192 times by 1 test | FALSE | evaluated 102 times by 1 test |
| 102-192 |
908 | ) == 1) && (__s2_len = __builtin_strlen (TRUE | evaluated 192 times by 1 test | FALSE | evaluated 102 times by 1 test |
| 102-192 |
909 | "-"TRUE | evaluated 192 times by 1 test | FALSE | evaluated 102 times by 1 test |
| 102-192 |
910 | ), __s2_len < 4) ? (__builtin_constant_p (TRUE | evaluated 192 times by 1 test | FALSE | evaluated 102 times by 1 test |
| 102-192 |
911 | fileTRUE | evaluated 192 times by 1 test | FALSE | evaluated 102 times by 1 test |
| 102-192 |
912 | ) && ((size_t)(const void *)((TRUE | evaluated 192 times by 1 test | FALSE | evaluated 102 times by 1 test |
| 102-192 |
913 | fileTRUE | evaluated 192 times by 1 test | FALSE | evaluated 102 times by 1 test |
| 102-192 |
914 | ) + 1) - (size_t)(const void *)(TRUE | evaluated 192 times by 1 test | FALSE | evaluated 102 times by 1 test |
| 102-192 |
915 | fileTRUE | evaluated 192 times by 1 test | FALSE | evaluated 102 times by 1 test |
| 102-192 |
916 | ) == 1) ? __builtin_strcmp (TRUE | evaluated 192 times by 1 test | FALSE | evaluated 102 times by 1 test |
| 102-192 |
917 | fileTRUE | evaluated 192 times by 1 test | FALSE | evaluated 102 times by 1 test |
| 102-192 |
918 | , TRUE | evaluated 192 times by 1 test | FALSE | evaluated 102 times by 1 test |
| 102-192 |
919 | "-"TRUE | evaluated 192 times by 1 test | FALSE | evaluated 102 times by 1 test |
| 102-192 |
920 | ) : -(__extension__ ({ const unsigned char *__s2 = (const unsigned char *) (const char *) (TRUE | evaluated 192 times by 1 test | FALSE | evaluated 102 times by 1 test |
| 102-192 |
921 | fileTRUE | evaluated 192 times by 1 test | FALSE | evaluated 102 times by 1 test |
| 102-192 |
922 | ); int __result = (((const unsigned char *) (const char *) (TRUE | evaluated 192 times by 1 test | FALSE | evaluated 102 times by 1 test |
| 102-192 |
923 | "-"TRUE | evaluated 192 times by 1 test | FALSE | evaluated 102 times by 1 test |
| 102-192 |
924 | ))[0] - __s2[0]); if (__s2_len > 0TRUE | evaluated 294 times by 1 test | FALSE | never evaluated |
&& __result == 0TRUE | evaluated 192 times by 1 test | FALSE | evaluated 102 times by 1 test |
) { __result = (((const unsigned char *) (const char *) (TRUE | evaluated 192 times by 1 test | FALSE | evaluated 102 times by 1 test |
| 0-294 |
925 | "-"TRUE | evaluated 192 times by 1 test | FALSE | evaluated 102 times by 1 test |
| 102-192 |
926 | ))[1] - __s2[1]); if (__s2_len > 1TRUE | never evaluated | FALSE | evaluated 192 times by 1 test |
&& __result == 0TRUE | never evaluated | FALSE | never evaluated |
) { __result = (((const unsigned char *) (const char *) (TRUE | evaluated 192 times by 1 test | FALSE | evaluated 102 times by 1 test |
| 0-192 |
927 | "-"TRUE | evaluated 192 times by 1 test | FALSE | evaluated 102 times by 1 test |
| 102-192 |
928 | ))[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 *) ( "-" ))[3] - __s2[3]); TRUE | evaluated 192 times by 1 test | FALSE | evaluated 102 times by 1 test |
| 0-192 |
929 | "-"TRUE | evaluated 192 times by 1 test | FALSE | evaluated 102 times by 1 test |
never executed: __result = (((const unsigned char *) (const char *) ( "-" ))[3] - __s2[3]); | 0-192 |
930 | ))[3] - __s2[3]);TRUE | evaluated 192 times by 1 test | FALSE | evaluated 102 times by 1 test |
never executed: __result = (((const unsigned char *) (const char *) ( "-" ))[3] - __s2[3]); }never executed: end of block } __result; }))) : __builtin_strcmp (TRUE | evaluated 192 times by 1 test | FALSE | evaluated 102 times by 1 test |
| 0-192 |
931 | fileTRUE | evaluated 192 times by 1 test | FALSE | evaluated 102 times by 1 test |
| 102-192 |
932 | , TRUE | evaluated 192 times by 1 test | FALSE | evaluated 102 times by 1 test |
| 102-192 |
933 | "-"TRUE | evaluated 192 times by 1 test | FALSE | evaluated 102 times by 1 test |
| 102-192 |
934 | )))); }) TRUE | evaluated 192 times by 1 test | FALSE | evaluated 102 times by 1 test |
| 102-192 |
935 | == 0)TRUE | evaluated 192 times by 1 test | FALSE | evaluated 102 times by 1 test |
) | 102-192 |
936 | clearerr_unlocked (stream);executed 192 times by 1 test: clearerr_unlocked (stream); | 192 |
937 | else if ( | - |
938 | rpl_fclose TRUE | never evaluated | FALSE | evaluated 102 times by 1 test |
| 0-102 |
939 | (stream) == TRUE | never evaluated | FALSE | evaluated 102 times by 1 test |
| 0-102 |
940 | (-1)TRUE | never evaluated | FALSE | evaluated 102 times by 1 test |
| 0-102 |
941 | ) | - |
942 | { | - |
943 | error (0, | - |
944 | (*__errno_location ()) | - |
945 | , "%s", quotearg_n_style_colon (0, shell_escape_quoting_style, file)); | - |
946 | return never executed: return 0 ; never executed: return 0 ; | 0 |
947 | 0 never executed: return 0 ; | 0 |
948 | ; never executed: return 0 ; | 0 |
949 | } | - |
950 | returnexecuted 294 times by 1 test: return 1 ; executed 294 times by 1 test: return 1 ; | 294 |
951 | 1executed 294 times by 1 test: return 1 ; | 294 |
952 | ;executed 294 times by 1 test: return 1 ; | 294 |
953 | } | - |
954 | | - |
955 | int | - |
956 | main (int argc, char **argv) | - |
957 | { | - |
958 | int optc; | - |
959 | | - |
960 | _Bool | - |
961 | ok; | - |
962 | | - |
963 | _Bool | - |
964 | delim_specified = | - |
965 | 0 | - |
966 | ; | - |
967 | char *spec_list_string ; | - |
968 | | - |
969 | ; | - |
970 | set_program_name (argv[0]); | - |
971 | setlocale ( | - |
972 | 6 | - |
973 | , ""); | - |
974 | bindtextdomain ("coreutils", "/usr/local/share/locale"); | - |
975 | textdomain ("coreutils"); | - |
976 | | - |
977 | atexit (close_stdout); | - |
978 | | - |
979 | operating_mode = undefined_mode; | - |
980 | | - |
981 | | - |
982 | suppress_non_delimited = | - |
983 | 0 | - |
984 | ; | - |
985 | | - |
986 | delim = '\0'; | - |
987 | have_read_stdin = | - |
988 | 0 | - |
989 | ; | - |
990 | | - |
991 | while ((TRUE | evaluated 714 times by 1 test | FALSE | evaluated 338 times by 1 test |
optc = getopt_long (argc, argv, "b:c:d:f:nsz", longopts, TRUE | evaluated 714 times by 1 test | FALSE | evaluated 338 times by 1 test |
| 338-714 |
992 | ((void *)0)TRUE | evaluated 714 times by 1 test | FALSE | evaluated 338 times by 1 test |
| 338-714 |
993 | )) != -1TRUE | evaluated 714 times by 1 test | FALSE | evaluated 338 times by 1 test |
) | 338-714 |
994 | { | - |
995 | switch (optc) | - |
996 | { | - |
997 | caseexecuted 69 times by 1 test: case 'b': 'b':executed 69 times by 1 test: case 'b': | 69 |
998 | caseexecuted 43 times by 1 test: case 'c': 'c':executed 43 times by 1 test: case 'c': | 43 |
999 | | - |
1000 | if (operating_mode != undefined_modeTRUE | never evaluated | FALSE | evaluated 112 times by 1 test |
) | 0-112 |
1001 | do { error (0, 0, ( | - |
1002 | dcgettext (((void *)0), | - |
1003 | "only one type of list may be specified" | - |
1004 | , 5) | - |
1005 | )); usage ( | - |
1006 | 1 | - |
1007 | ); } never executed: end of block while (0); | 0 |
1008 | operating_mode = byte_mode; | - |
1009 | spec_list_string = optarg; | - |
1010 | break;executed 112 times by 1 test: break; | 112 |
1011 | | - |
1012 | caseexecuted 223 times by 1 test: case 'f': 'f':executed 223 times by 1 test: case 'f': | 223 |
1013 | | - |
1014 | if (operating_mode != undefined_modeTRUE | never evaluated | FALSE | evaluated 223 times by 1 test |
) | 0-223 |
1015 | do { error (0, 0, ( | - |
1016 | dcgettext (((void *)0), | - |
1017 | "only one type of list may be specified" | - |
1018 | , 5) | - |
1019 | )); usage ( | - |
1020 | 1 | - |
1021 | ); } never executed: end of block while (0); | 0 |
1022 | operating_mode = field_mode; | - |
1023 | spec_list_string = optarg; | - |
1024 | break;executed 223 times by 1 test: break; | 223 |
1025 | | - |
1026 | caseexecuted 173 times by 1 test: case 'd': 'd':executed 173 times by 1 test: case 'd': | 173 |
1027 | | - |
1028 | | - |
1029 | if (optarg[0] != '\0'TRUE | evaluated 166 times by 1 test | FALSE | evaluated 7 times by 1 test |
&& optarg[1] != '\0'TRUE | never evaluated | FALSE | evaluated 166 times by 1 test |
) | 0-166 |
1030 | do { error (0, 0, ( | - |
1031 | dcgettext (((void *)0), | - |
1032 | "the delimiter must be a single character" | - |
1033 | , 5) | - |
1034 | )); usage ( | - |
1035 | 1 | - |
1036 | ); } never executed: end of block while (0); | 0 |
1037 | delim = optarg[0]; | - |
1038 | delim_specified = | - |
1039 | 1 | - |
1040 | ; | - |
1041 | break;executed 173 times by 1 test: break; | 173 |
1042 | | - |
1043 | caseexecuted 87 times by 1 test: case OUTPUT_DELIMITER_OPTION: OUTPUT_DELIMITER_OPTION:executed 87 times by 1 test: case OUTPUT_DELIMITER_OPTION: | 87 |
1044 | output_delimiter_specified = | - |
1045 | 1 | - |
1046 | ; | - |
1047 | | - |
1048 | | - |
1049 | output_delimiter_length = (optarg[0] == '\0'TRUE | evaluated 3 times by 1 test | FALSE | evaluated 84 times by 1 test |
| 3-84 |
1050 | ? 1 : strlen (optarg)); | - |
1051 | output_delimiter_string = xstrdup (optarg); | - |
1052 | break;executed 87 times by 1 test: break; | 87 |
1053 | | - |
1054 | case never executed: case 'n': 'n':never executed: case 'n': | 0 |
1055 | break; never executed: break; | 0 |
1056 | | - |
1057 | caseexecuted 90 times by 1 test: case 's': 's':executed 90 times by 1 test: case 's': | 90 |
1058 | suppress_non_delimited = | - |
1059 | 1 | - |
1060 | ; | - |
1061 | break;executed 90 times by 1 test: break; | 90 |
1062 | | - |
1063 | caseexecuted 18 times by 1 test: case 'z': 'z':executed 18 times by 1 test: case 'z': | 18 |
1064 | line_delim = '\0'; | - |
1065 | break;executed 18 times by 1 test: break; | 18 |
1066 | | - |
1067 | caseexecuted 3 times by 1 test: case COMPLEMENT_OPTION: COMPLEMENT_OPTION:executed 3 times by 1 test: case COMPLEMENT_OPTION: | 3 |
1068 | complement = | - |
1069 | 1 | - |
1070 | ; | - |
1071 | break;executed 3 times by 1 test: break; | 3 |
1072 | | - |
1073 | caseexecuted 2 times by 1 test: case GETOPT_HELP_CHAR: GETOPT_HELP_CHAR:executed 2 times by 1 test: case GETOPT_HELP_CHAR: usage ( | 2 |
1074 | 0 | - |
1075 | ); break; never executed: break; ; | 0 |
1076 | | - |
1077 | caseexecuted 5 times by 1 test: case GETOPT_VERSION_CHAR: GETOPT_VERSION_CHAR:executed 5 times by 1 test: case GETOPT_VERSION_CHAR: version_etc ( | 5 |
1078 | stdout | - |
1079 | , "cut", "GNU coreutils", Version, ("David M. Ihnat"), ("David MacKenzie"), ("Jim Meyering"), (char *) | - |
1080 | ((void *)0) | - |
1081 | ); exit (executed 5 times by 1 test: exit ( 0 ); | 5 |
1082 | 0executed 5 times by 1 test: exit ( 0 ); | 5 |
1083 | );executed 5 times by 1 test: exit ( 0 ); break;never executed: break; ; | 0-5 |
1084 | | - |
1085 | defaultexecuted 1 time by 1 test: default: :executed 1 time by 1 test: default: | 1 |
1086 | usage ( | - |
1087 | 1 | - |
1088 | ); | - |
1089 | } never executed: end of block | 0 |
1090 | } | - |
1091 | | - |
1092 | if (operating_mode == undefined_modeTRUE | evaluated 3 times by 1 test | FALSE | evaluated 335 times by 1 test |
) | 3-335 |
1093 | do { error (0, 0, ( | - |
1094 | dcgettext (((void *)0), | - |
1095 | "you must specify a list of bytes, characters, or fields" | - |
1096 | , 5) | - |
1097 | )); usage ( | - |
1098 | 1 | - |
1099 | ); } never executed: end of block while (0); | 0 |
1100 | | - |
1101 | if (delim_specifiedTRUE | evaluated 173 times by 1 test | FALSE | evaluated 162 times by 1 test |
&& operating_mode != field_modeTRUE | evaluated 2 times by 1 test | FALSE | evaluated 171 times by 1 test |
) | 2-173 |
1102 | do { error (0, 0, ( | - |
1103 | dcgettext (((void *)0), | - |
1104 | "an input delimiter may be specified only when operating on fields" | - |
1105 | , 5) | - |
1106 | )); usage ( | - |
1107 | 1 | - |
1108 | ); } never executed: end of block while (0) | 0 |
1109 | ; | - |
1110 | | - |
1111 | if (suppress_non_delimitedTRUE | evaluated 90 times by 1 test | FALSE | evaluated 243 times by 1 test |
&& operating_mode != field_modeTRUE | evaluated 3 times by 1 test | FALSE | evaluated 87 times by 1 test |
) | 3-243 |
1112 | do { error (0, 0, ( | - |
1113 | dcgettext (((void *)0), | - |
1114 | "suppressing non-delimited lines makes sense\n\tonly when operating on fields" | - |
1115 | , 5) | - |
1116 | )); usage ( | - |
1117 | 1 | - |
1118 | ); } never executed: end of block while (0) | 0 |
1119 | ; | - |
1120 | | - |
1121 | set_fields (spec_list_string, | - |
1122 | ( (operating_mode == field_mode) ? 0 : SETFLD_ERRMSG_USE_POS) | - |
1123 | | (complement ? SETFLD_COMPLEMENT : 0) ); | - |
1124 | | - |
1125 | if (!delim_specifiedTRUE | evaluated 122 times by 1 test | FALSE | evaluated 171 times by 1 test |
) | 122-171 |
1126 | delim = '\t';executed 122 times by 1 test: delim = '\t'; | 122 |
1127 | | - |
1128 | if (output_delimiter_string == TRUE | evaluated 206 times by 1 test | FALSE | evaluated 87 times by 1 test |
| 87-206 |
1129 | ((void *)0)TRUE | evaluated 206 times by 1 test | FALSE | evaluated 87 times by 1 test |
| 87-206 |
1130 | ) | - |
1131 | { | - |
1132 | static char dummy[2]; | - |
1133 | dummy[0] = delim; | - |
1134 | dummy[1] = '\0'; | - |
1135 | output_delimiter_string = dummy; | - |
1136 | output_delimiter_length = 1; | - |
1137 | }executed 206 times by 1 test: end of block | 206 |
1138 | | - |
1139 | if (optind == argcTRUE | evaluated 192 times by 1 test | FALSE | evaluated 101 times by 1 test |
) | 101-192 |
1140 | ok = cut_file ("-");executed 192 times by 1 test: ok = cut_file ("-"); | 192 |
1141 | else | - |
1142 | for (ok = | - |
1143 | 1 | - |
1144 | ; optind < argcTRUE | evaluated 102 times by 1 test | FALSE | evaluated 101 times by 1 test |
; optind++) | 101-102 |
1145 | ok &= cut_file (argv[optind]);executed 102 times by 1 test: ok &= cut_file (argv[optind]); | 102 |
1146 | | - |
1147 | | - |
1148 | if (have_read_stdinTRUE | evaluated 192 times by 1 test | FALSE | evaluated 101 times by 1 test |
&& | 101-192 |
1149 | rpl_fclose TRUE | never evaluated | FALSE | evaluated 192 times by 1 test |
| 0-192 |
1150 | (TRUE | never evaluated | FALSE | evaluated 192 times by 1 test |
| 0-192 |
1151 | stdinTRUE | never evaluated | FALSE | evaluated 192 times by 1 test |
| 0-192 |
1152 | ) == TRUE | never evaluated | FALSE | evaluated 192 times by 1 test |
| 0-192 |
1153 | (-1)TRUE | never evaluated | FALSE | evaluated 192 times by 1 test |
| 0-192 |
1154 | ) | - |
1155 | { | - |
1156 | error (0, | - |
1157 | (*__errno_location ()) | - |
1158 | , "-"); | - |
1159 | ok = | - |
1160 | 0 | - |
1161 | ; | - |
1162 | } never executed: end of block | 0 |
1163 | | - |
1164 | ; | - |
1165 | | - |
1166 | returnexecuted 293 times by 1 test: return ok ? 0 : 1 ; ok ? executed 293 times by 1 test: return ok ? 0 : 1 ; | 293 |
1167 | 0 executed 293 times by 1 test: return ok ? 0 : 1 ; | 293 |
1168 | : executed 293 times by 1 test: return ok ? 0 : 1 ; | 293 |
1169 | 1executed 293 times by 1 test: return ok ? 0 : 1 ; | 293 |
1170 | ;executed 293 times by 1 test: return ok ? 0 : 1 ; | 293 |
1171 | } | - |
| | |