diff options
author | ph10 <ph10@6239d852-aaf2-0410-a92c-79f79f948069> | 2018-02-19 14:49:42 +0000 |
---|---|---|
committer | ph10 <ph10@6239d852-aaf2-0410-a92c-79f79f948069> | 2018-02-19 14:49:42 +0000 |
commit | 1890db00e66f40d659470a8a988d71daf59a29f9 (patch) | |
tree | 34a84f3aa918c3cfcc8404dfcb8e895ca137b7b4 /src/pcre2test.c | |
parent | 54a2a3cb6d78dfb6b91087f08d06d92497c7ef0a (diff) | |
download | pcre2-1890db00e66f40d659470a8a988d71daf59a29f9.tar.gz |
Fix the value passed back for POSIX unset groups when REG_STARTEND has a
non-zero starting offset, and make pcre2test show relevant POSIX unset groups.
git-svn-id: svn://vcs.exim.org/pcre2/code/trunk@915 6239d852-aaf2-0410-a92c-79f79f948069
Diffstat (limited to 'src/pcre2test.c')
-rw-r--r-- | src/pcre2test.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/pcre2test.c b/src/pcre2test.c index 15bf404..7eca618 100644 --- a/src/pcre2test.c +++ b/src/pcre2test.c @@ -11,7 +11,7 @@ hacked-up (non-) design had also run out of steam. Written by Philip Hazel Original code Copyright (c) 1997-2012 University of Cambridge - Rewritten code Copyright (c) 2016-2017 University of Cambridge + Rewritten code Copyright (c) 2016-2018 University of Cambridge ----------------------------------------------------------------------------- Redistribution and use in source and binary forms, with or without @@ -6761,13 +6761,17 @@ if ((pat_patctl.control & CTL_POSIX) != 0) fprintf(outfile, "Matched without capture\n"); else { - size_t i; + size_t i, j; + size_t last_printed = (size_t)dat_datctl.oveccount; for (i = 0; i < (size_t)dat_datctl.oveccount; i++) { if (pmatch[i].rm_so >= 0) { PCRE2_SIZE start = pmatch[i].rm_so; PCRE2_SIZE end = pmatch[i].rm_eo; + for (j = last_printed + 1; j < i; j++) + fprintf(outfile, "%2d: <unset>\n", (int)j); + last_printed = i; if (start > end) { start = pmatch[i].rm_eo; |