mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Merge upstream bugfix for regex engine
https://code.google.com/p/mrab-regex-hg/source/detail?r=69cdaa98c25506c226717967be7131d06f1d54dd
This commit is contained in:
parent
33bd823fdf
commit
4ed9aa6380
@ -11767,15 +11767,7 @@ backtrack:
|
|||||||
|
|
||||||
ch = test->values[0];
|
ch = test->values[0];
|
||||||
|
|
||||||
/* The tail is a character. We don't want to go off the end
|
|
||||||
* of the slice.
|
|
||||||
*/
|
|
||||||
limit = RE_MAX(limit, slice_start + 1);
|
|
||||||
|
|
||||||
for (;;) {
|
for (;;) {
|
||||||
if (pos <= limit)
|
|
||||||
break;
|
|
||||||
|
|
||||||
--pos;
|
--pos;
|
||||||
|
|
||||||
if ((char_at(text, pos) == ch) == m &&
|
if ((char_at(text, pos) == ch) == m &&
|
||||||
@ -11784,6 +11776,10 @@ backtrack:
|
|||||||
match = TRUE;
|
match = TRUE;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (pos == limit)
|
||||||
|
break;
|
||||||
|
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -11793,15 +11789,7 @@ backtrack:
|
|||||||
|
|
||||||
ch = test->values[0];
|
ch = test->values[0];
|
||||||
|
|
||||||
/* The tail is a character. We don't want to go off the end
|
|
||||||
* of the slice.
|
|
||||||
*/
|
|
||||||
limit = RE_MAX(limit, slice_start + 1);
|
|
||||||
|
|
||||||
for (;;) {
|
for (;;) {
|
||||||
if (pos <= limit)
|
|
||||||
break;
|
|
||||||
|
|
||||||
--pos;
|
--pos;
|
||||||
|
|
||||||
if (same_char_ign(encoding, char_at(text, pos), ch) ==
|
if (same_char_ign(encoding, char_at(text, pos), ch) ==
|
||||||
@ -11810,6 +11798,10 @@ backtrack:
|
|||||||
match = TRUE;
|
match = TRUE;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (pos == limit)
|
||||||
|
break;
|
||||||
|
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -11819,15 +11811,7 @@ backtrack:
|
|||||||
|
|
||||||
ch = test->values[0];
|
ch = test->values[0];
|
||||||
|
|
||||||
/* The tail is a character. We don't want to go off the end
|
|
||||||
* of the slice.
|
|
||||||
*/
|
|
||||||
limit = RE_MIN(limit, slice_end - 1);
|
|
||||||
|
|
||||||
for (;;) {
|
for (;;) {
|
||||||
if (pos >= limit)
|
|
||||||
break;
|
|
||||||
|
|
||||||
++pos;
|
++pos;
|
||||||
|
|
||||||
if (same_char_ign(encoding, char_at(text, pos - 1), ch)
|
if (same_char_ign(encoding, char_at(text, pos - 1), ch)
|
||||||
@ -11836,6 +11820,10 @@ backtrack:
|
|||||||
match = TRUE;
|
match = TRUE;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (pos == limit)
|
||||||
|
break;
|
||||||
|
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -11845,15 +11833,7 @@ backtrack:
|
|||||||
|
|
||||||
ch = test->values[0];
|
ch = test->values[0];
|
||||||
|
|
||||||
/* The tail is a character. We don't want to go off the end
|
|
||||||
* of the slice.
|
|
||||||
*/
|
|
||||||
limit = RE_MIN(limit, slice_end - 1);
|
|
||||||
|
|
||||||
for (;;) {
|
for (;;) {
|
||||||
if (pos >= limit)
|
|
||||||
break;
|
|
||||||
|
|
||||||
++pos;
|
++pos;
|
||||||
|
|
||||||
if ((char_at(text, pos - 1) == ch) == m &&
|
if ((char_at(text, pos - 1) == ch) == m &&
|
||||||
@ -11862,6 +11842,10 @@ backtrack:
|
|||||||
match = TRUE;
|
match = TRUE;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (pos == limit)
|
||||||
|
break;
|
||||||
|
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user