| 847 | /* Split the input file according to the control records we have built. */ |
| 848 | |
| 849 | static void |
| 850 | split_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 |
no test coverage detected