| 1 |
struct re_pattern_buffer { |
| 2 |
unsigned char *buffer; |
| 3 |
unsigned long int allocated; |
| 4 |
}; |
| 5 |
void byte_regex_compile (struct re_pattern_buffer *bufp, |
| 6 |
unsigned char *begalt, unsigned char *b) |
| 7 |
{ |
| 8 |
unsigned char *pfrom; |
| 9 |
unsigned char *pto; |
| 10 |
|
| 11 |
while ((unsigned long) (b - bufp->buffer + 3) > bufp->allocated) |
| 12 |
{ |
| 13 |
unsigned char *old_buffer = bufp->buffer; |
| 14 |
bufp->allocated <<= 1; |
| 15 |
if (old_buffer != bufp->buffer) |
| 16 |
{ |
| 17 |
int incr = bufp->buffer - old_buffer; |
| 18 |
b += incr; |
| 19 |
} |
| 20 |
} |
| 21 |
pfrom = b; |
| 22 |
pto = b + 3; |
| 23 |
while (pfrom != begalt) |
| 24 |
*--pto = *--pfrom; |
| 25 |
} |
| 26 |
|