Revision: 877
http://www.exim.org/viewvc/pcre2?view=rev&revision=877
Author: ph10
Date: 2017-11-09 17:50:59 +0000 (Thu, 09 Nov 2017)
Log Message:
-----------
Remove superflous variable.
Modified Paths:
--------------
code/trunk/src/pcre2grep.c
Modified: code/trunk/src/pcre2grep.c
===================================================================
--- code/trunk/src/pcre2grep.c 2017-10-29 16:58:38 UTC (rev 876)
+++ code/trunk/src/pcre2grep.c 2017-11-09 17:50:59 UTC (rev 877)
@@ -2365,7 +2365,6 @@
int mrc = 0;
unsigned int options = 0;
BOOL match;
- char *matchptr = ptr;
char *t = ptr;
size_t length, linelength;
size_t startoffset = 0;
@@ -2503,7 +2502,7 @@
match, set PCRE2_NOTEMPTY to disable any further matches of null strings in
this line. */
- match = match_patterns(matchptr, length, options, startoffset, &mrc);
+ match = match_patterns(ptr, length, options, startoffset, &mrc);
options = PCRE2_NOTEMPTY;
/* If it's a match or a not-match (as required), do what's wanted. */
@@ -2564,7 +2563,7 @@
/* Handle --line-offsets */
if (line_offsets)
- fprintf(stdout, "%d,%d" STDOUT_NL, (int)(matchptr + offsets[0] - ptr),
+ fprintf(stdout, "%d,%d" STDOUT_NL, (int)(ptr + offsets[0] - ptr),
(int)(offsets[1] - offsets[0]));
/* Handle --file-offsets */
@@ -2571,7 +2570,7 @@
else if (file_offsets)
fprintf(stdout, "%d,%d" STDOUT_NL,
- (int)(filepos + matchptr + offsets[0] - ptr),
+ (int)(filepos + ptr + offsets[0] - ptr),
(int)(offsets[1] - offsets[0]));
/* Handle --output (which has already been syntax checked) */
@@ -2579,7 +2578,7 @@
else if (output_text != NULL)
{
if (display_output_text((PCRE2_SPTR)output_text, FALSE,
- (PCRE2_SPTR)matchptr, offsets, mrc) || printname != NULL ||
+ (PCRE2_SPTR)ptr, offsets, mrc) || printname != NULL ||
number)
fprintf(stdout, STDOUT_NL);
}
@@ -2601,7 +2600,7 @@
{
if (printed && om_separator != NULL)
fprintf(stdout, "%s", om_separator);
- print_match(matchptr + offsets[n*2], plen);
+ print_match(ptr + offsets[n*2], plen);
printed = TRUE;
}
}
@@ -2628,7 +2627,7 @@
{
if (startoffset >= length) goto END_ONE_MATCH; /* Were at end */
startoffset = oldstartoffset + 1;
- if (utf) while ((matchptr[startoffset] & 0xc0) == 0x80) startoffset++;
+ if (utf) while ((ptr[startoffset] & 0xc0) == 0x80) startoffset++;
}
/* If the current match ended past the end of the line (only possible
@@ -2637,7 +2636,7 @@
while (startoffset > linelength)
{
- matchptr = ptr += linelength + endlinelength;
+ ptr += linelength + endlinelength;
filepos += (int)(linelength + endlinelength);
linenumber++;
startoffset -= (int)(linelength + endlinelength);
@@ -2784,10 +2783,10 @@
{
startoffset = offsets[1];
if (startoffset >= linelength + endlinelength ||
- !match_patterns(matchptr, length, options, startoffset, &mrc))
+ !match_patterns(ptr, length, options, startoffset, &mrc))
break;
- FWRITE_IGNORE(matchptr + startoffset, 1, offsets[0] - startoffset, stdout);
- print_match(matchptr + offsets[0], offsets[1] - offsets[0]);
+ FWRITE_IGNORE(ptr + startoffset, 1, offsets[0] - startoffset, stdout);
+ print_match(ptr + offsets[0], offsets[1] - offsets[0]);
}
/* In multiline mode, we may have already printed the complete line