Branch: Tag:

2016-10-14

2016-10-14 12:20:30 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).

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