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

Function split_file

src/csplit.c:849–871  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

847/* Split the input file according to the control records we have built. */
848
849static void
850split_file (void)
851{
852 for (idx_t i = 0; i < control_used; i++)
853 {
854 if (controls[i].regexpr)
855 {
856 for (intmax_t j = 0; (controls[i].repeat_forever
857 || j <= controls[i].repeat); j++)
858 process_regexp (&controls[i], j);
859 }
860 else
861 {
862 for (intmax_t j = 0; (controls[i].repeat_forever
863 || j <= controls[i].repeat); j++)
864 process_line_count (&controls[i], j);
865 }
866 }
867
868 create_output_file ();
869 dump_rest_of_file ();
870 close_output_file ();
871}
872
873/* Return the name of output file number NUM.
874

Callers 1

mainFunction · 0.85

Calls 5

process_regexpFunction · 0.85
process_line_countFunction · 0.85
create_output_fileFunction · 0.85
dump_rest_of_fileFunction · 0.85
close_output_fileFunction · 0.85

Tested by

no test coverage detected