Utility to jump whitespace and cr/lf */
| 1032 | |
| 1033 | /* Utility to jump whitespace and cr/lf */ |
| 1034 | static parse_buffer *buffer_skip_whitespace(parse_buffer * const buffer) |
| 1035 | { |
| 1036 | if ((buffer == NULL) || (buffer->content == NULL)) |
| 1037 | { |
| 1038 | return NULL; |
| 1039 | } |
| 1040 | |
| 1041 | if (cannot_access_at_index(buffer, 0)) |
| 1042 | { |
| 1043 | return buffer; |
| 1044 | } |
| 1045 | |
| 1046 | while (can_access_at_index(buffer, 0) && (buffer_at_offset(buffer)[0] <= 32)) |
| 1047 | { |
| 1048 | buffer->offset++; |
| 1049 | } |
| 1050 | |
| 1051 | if (buffer->offset == buffer->length) |
| 1052 | { |
| 1053 | buffer->offset--; |
| 1054 | } |
| 1055 | |
| 1056 | return buffer; |
| 1057 | } |
| 1058 | |
| 1059 | /* skip the UTF-8 BOM (byte order mark) if it is at the beginning of a buffer */ |
| 1060 | static parse_buffer *skip_utf8_bom(parse_buffer * const buffer) |
no outgoing calls
no test coverage detected