Utility to jump whitespace and cr/lf */
| 1088 | |
| 1089 | /* Utility to jump whitespace and cr/lf */ |
| 1090 | static parse_buffer *buffer_skip_whitespace(parse_buffer * const buffer) |
| 1091 | { |
| 1092 | if ((buffer == NULL) || (buffer->content == NULL)) |
| 1093 | { |
| 1094 | return NULL; |
| 1095 | } |
| 1096 | |
| 1097 | if (cannot_access_at_index(buffer, 0)) |
| 1098 | { |
| 1099 | return buffer; |
| 1100 | } |
| 1101 | |
| 1102 | while (can_access_at_index(buffer, 0) && (buffer_at_offset(buffer)[0] <= 32)) |
| 1103 | { |
| 1104 | buffer->offset++; |
| 1105 | } |
| 1106 | |
| 1107 | if (buffer->offset == buffer->length) |
| 1108 | { |
| 1109 | buffer->offset--; |
| 1110 | } |
| 1111 | |
| 1112 | return buffer; |
| 1113 | } |
| 1114 | |
| 1115 | /* skip the UTF-8 BOM (byte order mark) if it is at the beginning of a buffer */ |
| 1116 | static parse_buffer *skip_utf8_bom(parse_buffer * const buffer) |
no outgoing calls
no test coverage detected