Return a pointer to the beginning of the next field in line. The line pointer is moved to the end of the next field. */
| 1406 | /* Return a pointer to the beginning of the next field in line. |
| 1407 | The line pointer is moved to the end of the next field. */ |
| 1408 | static char * |
| 1409 | next_field (char **line) |
| 1410 | { |
| 1411 | char *field_start = *line; |
| 1412 | char *field_end = field_start; |
| 1413 | |
| 1414 | if (delimiter) |
| 1415 | { |
| 1416 | if (! (field_end = mbsmbchr (field_start, delimiter))) |
| 1417 | field_end = strchr (field_start, '\0'); |
| 1418 | } |
| 1419 | else |
| 1420 | { |
| 1421 | /* keep any space prefix in the returned field */ |
| 1422 | field_end = skip_str_matching (field_end, newline_or_blank, true); |
| 1423 | field_end = skip_str_matching (field_end, newline_or_blank, false); |
| 1424 | } |
| 1425 | |
| 1426 | *line = field_end; |
| 1427 | return field_start; |
| 1428 | } |
| 1429 | |
| 1430 | ATTRIBUTE_PURE |
| 1431 | static bool |
no test coverage detected