| 314 | /* Fill in the 'fields' structure in LINE. */ |
| 315 | |
| 316 | static void |
| 317 | xfields (struct line *line) |
| 318 | { |
| 319 | char *ptr = line->buf.buffer; |
| 320 | char const *lim = ptr + line->buf.length - 1; |
| 321 | |
| 322 | if (ptr == lim) |
| 323 | return; |
| 324 | |
| 325 | if (!tab.len) |
| 326 | while ((ptr = skip_buf_matching (ptr, lim, newline_or_blank, true)) < lim) |
| 327 | { |
| 328 | char *sep = skip_buf_matching (ptr, lim, newline_or_blank, false); |
| 329 | extract_field (line, ptr, sep - ptr); |
| 330 | ptr = sep; |
| 331 | } |
| 332 | else |
| 333 | { |
| 334 | if (tab.ch != '\n') |
| 335 | for (char *sep; |
| 336 | (sep = skip_buf_matching (ptr, lim, eq_tab, false)) < lim; |
| 337 | ptr = sep + mcel_scan (sep, lim).len) |
| 338 | extract_field (line, ptr, sep - ptr); |
| 339 | |
| 340 | extract_field (line, ptr, lim - ptr); |
| 341 | } |
| 342 | } |
| 343 | |
| 344 | static void |
| 345 | freeline (struct line *line) |
no test coverage detected