Give some offset information for errors in pcre2test hex patterns.
This commit is contained in:
parent
9afb978ae4
commit
bc48f4709c
|
@ -179,6 +179,8 @@ compliant and unique.
|
|||
-lpcre2-posix. Also, the CMake build process was building the library with the
|
||||
wrong name.
|
||||
|
||||
27. In pcre2test, give some offset information for errors in hex patterns.
|
||||
|
||||
|
||||
Version 10.22 29-July-2016
|
||||
--------------------------
|
||||
|
|
|
@ -4632,12 +4632,14 @@ if ((pat_patctl.control & CTL_HEXPAT) != 0)
|
|||
|
||||
if (c == '\'' || c == '"')
|
||||
{
|
||||
uint8_t *pq = pp;
|
||||
for (;; pp++)
|
||||
{
|
||||
d = *pp;
|
||||
if (d == 0)
|
||||
{
|
||||
fprintf(outfile, "** Missing closing quote in hex pattern\n");
|
||||
fprintf(outfile, "** Missing closing quote in hex pattern: "
|
||||
"opening quote is at offset %lu.\n", pq - buffer - 2);
|
||||
return PR_SKIP;
|
||||
}
|
||||
if (d == c) break;
|
||||
|
@ -4651,8 +4653,8 @@ if ((pat_patctl.control & CTL_HEXPAT) != 0)
|
|||
{
|
||||
if (!isxdigit(c))
|
||||
{
|
||||
fprintf(outfile, "** Unexpected non-hex-digit '%c' in hex pattern: "
|
||||
"quote missing?\n", c);
|
||||
fprintf(outfile, "** Unexpected non-hex-digit '%c' at offset %lu "
|
||||
"in hex pattern: quote missing?\n", c, pp - buffer - 2);
|
||||
return PR_SKIP;
|
||||
}
|
||||
if (*pp == 0)
|
||||
|
@ -4663,8 +4665,8 @@ if ((pat_patctl.control & CTL_HEXPAT) != 0)
|
|||
d = *pp;
|
||||
if (!isxdigit(d))
|
||||
{
|
||||
fprintf(outfile, "** Unexpected non-hex-digit '%c' in hex pattern: "
|
||||
"quote missing?\n", d);
|
||||
fprintf(outfile, "** Unexpected non-hex-digit '%c' at offset %lu "
|
||||
"in hex pattern: quote missing?\n", d, pp - buffer - 1);
|
||||
return PR_SKIP;
|
||||
}
|
||||
c = toupper(c);
|
||||
|
|
Loading…
Reference in New Issue