This commit is contained in:
Kovid Goyal
2023-11-10 09:20:01 +05:30
parent 859b0cc585
commit 89d416806b
3 changed files with 4 additions and 4 deletions

View File

@@ -88,6 +88,6 @@ find_either_of_two_chars_simple(uint8_t *haystack, const size_t sz, const uint8_
#undef SHIFT_OP
uint8_t*
find_either_of_two_chars(uint8_t *haystack, const size_t sz, const uint8_t a, const uint8_t b) {
find_either_of_two_bytes(uint8_t *haystack, const size_t sz, const uint8_t a, const uint8_t b) {
return find_either_of_two_chars_simple(haystack, sz, a, b);
}

View File

@@ -20,4 +20,4 @@ typedef struct ByteLoader {
uint8_t byte_loader_peek(const ByteLoader *self);
void byte_loader_init(ByteLoader *self, const uint8_t *buf, unsigned int sz);
uint8_t byte_loader_next(ByteLoader *self);
uint8_t* find_either_of_two_chars(uint8_t *haystack, const size_t sz, const uint8_t a, const uint8_t b);
uint8_t* find_either_of_two_bytes(uint8_t *haystack, const size_t sz, const uint8_t a, const uint8_t b);

View File

@@ -396,7 +396,7 @@ consume_esc(PS *self) {
static bool
find_st_terminator(PS *self, size_t *end_pos) {
const size_t sz = self->read.sz - self->read.pos;
uint8_t *q = find_either_of_two_chars(self->buf + self->read.pos, sz, BEL, ESC_ST);
uint8_t *q = find_either_of_two_bytes(self->buf + self->read.pos, sz, BEL, ESC_ST);
if (q == NULL) {
self->read.pos += sz;
return false;
@@ -1447,7 +1447,7 @@ consume_input(PS *self) {
static bool
find_pending_stop_csi(PS *self) {
const size_t sz = self->read.sz - self->read.pos;
uint8_t *q = find_either_of_two_chars(self->buf + self->read.pos, sz, ESC, 'l');
uint8_t *q = find_either_of_two_bytes(self->buf + self->read.pos, sz, ESC, 'l');
if (q == NULL) {
self->read.pos += sz;
return false;