| 5118 | } |
| 5119 | |
| 5120 | static void |
| 5121 | print_horizontal (void) |
| 5122 | { |
| 5123 | size_t pos = 0; |
| 5124 | idx_t cols = calculate_columns (false); |
| 5125 | struct column_info const *line_fmt = &column_info[cols - 1]; |
| 5126 | struct fileinfo const *f = sorted_file[0]; |
| 5127 | size_t name_length = length_of_file_name_and_frills (f); |
| 5128 | size_t max_name_length = line_fmt->col_arr[0]; |
| 5129 | |
| 5130 | /* Print first entry. */ |
| 5131 | print_file_name_and_frills (f, 0); |
| 5132 | |
| 5133 | /* Now the rest. */ |
| 5134 | for (idx_t filesno = 1; filesno < cwd_n_used; filesno++) |
| 5135 | { |
| 5136 | idx_t col = filesno % cols; |
| 5137 | |
| 5138 | if (col == 0) |
| 5139 | { |
| 5140 | putchar (eolbyte); |
| 5141 | pos = 0; |
| 5142 | } |
| 5143 | else |
| 5144 | { |
| 5145 | indent (pos + name_length, pos + max_name_length); |
| 5146 | pos += max_name_length; |
| 5147 | } |
| 5148 | |
| 5149 | f = sorted_file[filesno]; |
| 5150 | print_file_name_and_frills (f, pos); |
| 5151 | |
| 5152 | name_length = length_of_file_name_and_frills (f); |
| 5153 | max_name_length = line_fmt->col_arr[col]; |
| 5154 | } |
| 5155 | putchar (eolbyte); |
| 5156 | } |
| 5157 | |
| 5158 | /* Output name + SEP + ' '. */ |
| 5159 |
no test coverage detected