Branch: Tag:

2020-10-28

2020-10-28 12:06:20 by Henrik Grubbström (Grubba) <grubba@grubba.org>

Stdio.Buffer [search]: _search() now behaves as documented.

Return UNDEFINED instead of -1 on failure (as -1 is a valid result).

1844:    INT_TYPE bytes = end->u.integer;       if (bytes < 0) { -  push_int(-1); +  push_undefined();    return;    }    if (((size_t)bytes) < io_len(io)) {
1857:       if (bytes >= 0) {    if (((size_t)bytes) >= io_len(io)) { -  push_int(-1); +  push_undefined();    return;    }    } else if (((size_t)(-bytes)) > io->offset) {
1874:    buf++;    }    -  push_int(-1); +  push_undefined();    }       /*! @decl Buffer read_hbuffer( int n )