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

Function check_section

src/nl.c:406–424  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

404/* Return the type of line in 'line_buf'. */
405
406static enum section
407check_section (void)
408{
409 size_t len = line_buf.length - 1;
410
411 if (len < section_del_len || footer_del_len < section_del_len
412 || !memeq (line_buf.buffer, section_del, section_del_len))
413 return Text;
414 if (len == header_del_len
415 && memeq (line_buf.buffer, header_del, header_del_len))
416 return Header;
417 if (len == body_del_len
418 && memeq (line_buf.buffer, body_del, body_del_len))
419 return Body;
420 if (len == footer_del_len
421 && memeq (line_buf.buffer, footer_del, footer_del_len))
422 return Footer;
423 return Text;
424}
425
426/* Read and process the file pointed to by FP. */
427

Callers 1

process_fileFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected