Fix spurious error in pcre2test when single-letter modifiers at the end of a line have trailing spaces.

This commit is contained in:
Philip.Hazel 2015-10-22 15:49:54 +00:00
parent 2f542eb1c5
commit 8a8d0ced69
2 changed files with 8 additions and 1 deletions

View File

@ -210,6 +210,9 @@ erroneous error "\ at end of pattern".
errors or other strange effects if compiled in UCP mode. Found with libFuzzer
and AddressSanitizer.
61. Whitespace at the end of a pcre2test pattern line caused a spurious error
message if there were only single-character modifiers. It should be ignored.
Version 10.20 30-June-2015
--------------------------

View File

@ -3111,7 +3111,11 @@ for (;;)
/* Find the end of the item; lose trailing whitespace at end of line. */
for (ep = p; *ep != 0 && *ep != ','; ep++);
if (*ep == 0) while (ep > p && isspace(ep[-1])) ep--;
if (*ep == 0)
{
while (ep > p && isspace(ep[-1])) ep--;
*ep = 0;
}
/* Remember if the first character is '-'. */