fix 8184: don't get stuck on %{ that's not at the beginning of the line, and mind end of data

This commit is contained in:
shaver%netscape.com 1999-06-15 14:17:21 +00:00
Родитель bba71a7ac3
Коммит ff57e68207
1 изменённых файлов: 3 добавлений и 3 удалений

Просмотреть файл

@ -223,7 +223,7 @@ new_input_callback_data(const char *filename, IncludePathEntry *include_path)
static int
NextIsRaw(struct input_callback_data *data, char **startp, int *lenp)
{
char *end, *start;
char *end, *start, *data_end = data->buf + data->len;
#ifdef DEBUG_shaver_input
fputs("[R]", stderr);
@ -236,11 +236,11 @@ NextIsRaw(struct input_callback_data *data, char **startp, int *lenp)
start = *startp = data->point;
while ((end = strstr(start, "%}"))) {
while (end < data_end && (end = strstr(start, "%}"))) {
if (end[-1] == '\r' ||
end[-1] == '\n')
break;
start = end;
start = end + 1;
}
if (end) {