MCPcopy Create free account
hub / github.com/coreutils/coreutils / read_line

Function read_line

src/pr.c:2435–2558  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2433 an end of line character, true otherwise. */
2434
2435static bool
2436read_line (COLUMN *p)
2437{
2438 int c;
2439 int chars IF_LINT (= 0);
2440 int last_input_position;
2441 int j, k;
2442 COLUMN *q;
2443
2444 /* read 1st character in each line or any character succeeding a FF: */
2445 c = getc (p->fp);
2446
2447 last_input_position = input_position;
2448
2449 if (c == '\f' && p->full_page_printed)
2450 if ((c = getc (p->fp)) == '\n')
2451 c = getc (p->fp);
2452 p->full_page_printed = false;
2453
2454 switch (c)
2455 {
2456 case '\f':
2457 if ((c = getc (p->fp)) != '\n')
2458 ungetc (c, p->fp);
2459 FF_only = true;
2460 if (print_a_header && !storing_columns)
2461 {
2462 pad_vertically = true;
2463 print_header ();
2464 }
2465 else if (keep_FF)
2466 print_a_FF = true;
2467 hold_file (p);
2468 return true;
2469 case EOF:
2470 close_file (p);
2471 return true;
2472 case '\n':
2473 break;
2474 default:
2475 chars = char_to_clump (c);
2476 }
2477
2478 if (truncate_lines && input_position > chars_per_column)
2479 {
2480 input_position = last_input_position;
2481 return false;
2482 }
2483
2484 if (p->char_func != store_char)
2485 {
2486 pad_vertically = true;
2487
2488 if (print_a_header && !storing_columns)
2489 print_header ();
2490
2491 if (parallel_files && align_empty_cols)
2492 {

Callers 1

store_columnsFunction · 0.85

Calls 9

print_headerFunction · 0.85
hold_fileFunction · 0.85
close_fileFunction · 0.85
char_to_clumpFunction · 0.85
align_columnFunction · 0.85
pad_across_toFunction · 0.85
print_sep_stringFunction · 0.85
add_line_numberFunction · 0.85
print_clumpFunction · 0.85

Tested by

no test coverage detected