"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "pcretest.c" between
pcre-8.43.tar.bz2 and pcre-8.44.tar.bz2

About: The PCRE library implements Perl compatible regular expression pattern matching.

pcretest.c  (pcre-8.43.tar.bz2):pcretest.c  (pcre-8.44.tar.bz2)
skipping to change at line 501 skipping to change at line 501
enum { enum {
PCRE8_MODE, PCRE8_MODE,
PCRE16_MODE, PCRE16_MODE,
PCRE32_MODE PCRE32_MODE
}; };
#if (defined (SUPPORT_PCRE8) + defined (SUPPORT_PCRE16) + \ #if (defined (SUPPORT_PCRE8) + defined (SUPPORT_PCRE16) + \
defined (SUPPORT_PCRE32)) >= 2 defined (SUPPORT_PCRE32)) >= 2
#define CHAR_SIZE (1 << pcre_mode) #define CHAR_SIZE (1U << pcre_mode)
/* There doesn't seem to be an easy way of writing these macros that can cope /* There doesn't seem to be an easy way of writing these macros that can cope
with the 3 pairs of bit sizes plus all three bit sizes. So just handle all the with the 3 pairs of bit sizes plus all three bit sizes. So just handle all the
cases separately. */ cases separately. */
/* ----- All three modes supported ----- */ /* ----- All three modes supported ----- */
#if defined(SUPPORT_PCRE8) && defined(SUPPORT_PCRE16) && defined(SUPPORT_PCRE32) #if defined(SUPPORT_PCRE8) && defined(SUPPORT_PCRE16) && defined(SUPPORT_PCRE32)
#define PCHARS(lv, p, offset, len, f) \ #define PCHARS(lv, p, offset, len, f) \
skipping to change at line 4385 skipping to change at line 4385
fwrite(re, 1, true_size, f) < true_size) fwrite(re, 1, true_size, f) < true_size)
{ {
fprintf(outfile, "Write error on %s: %s\n", to_file, strerror(errno)); fprintf(outfile, "Write error on %s: %s\n", to_file, strerror(errno));
} }
else else
{ {
fprintf(outfile, "Compiled pattern written to %s\n", to_file); fprintf(outfile, "Compiled pattern written to %s\n", to_file);
/* If there is study data, write it. */ /* If there is study data, write it. */
if (extra != NULL) if (extra != NULL && (extra->flags & PCRE_EXTRA_STUDY_DATA) != 0)
{ {
if (fwrite(extra->study_data, 1, true_study_size, f) < if (fwrite(extra->study_data, 1, true_study_size, f) <
true_study_size) true_study_size)
{ {
fprintf(outfile, "Write error on %s: %s\n", to_file, fprintf(outfile, "Write error on %s: %s\n", to_file,
strerror(errno)); strerror(errno));
} }
else fprintf(outfile, "Study data written to %s\n", to_file); else fprintf(outfile, "Study data written to %s\n", to_file);
} }
} }
skipping to change at line 4677 skipping to change at line 4677
continue; continue;
case 'B': case 'B':
options |= PCRE_NOTBOL; options |= PCRE_NOTBOL;
continue; continue;
case 'C': case 'C':
if (isdigit(*p)) /* Set copy string */ if (isdigit(*p)) /* Set copy string */
{ {
while(isdigit(*p)) n = n * 10 + *p++ - '0'; while(isdigit(*p)) n = n * 10 + *p++ - '0';
copystrings |= 1 << n; copystrings |= 1U << n;
} }
else if (isalnum(*p)) else if (isalnum(*p))
{ {
READ_CAPTURE_NAME(p, &cn8ptr, &cn16ptr, &cn32ptr, re); READ_CAPTURE_NAME(p, &cn8ptr, &cn16ptr, &cn32ptr, re);
} }
else if (*p == '+') else if (*p == '+')
{ {
callout_extra = 1; callout_extra = 1;
p++; p++;
} }
skipping to change at line 4740 skipping to change at line 4740
#if !defined NODFA #if !defined NODFA
case 'F': case 'F':
options |= PCRE_DFA_SHORTEST; options |= PCRE_DFA_SHORTEST;
continue; continue;
#endif #endif
case 'G': case 'G':
if (isdigit(*p)) if (isdigit(*p))
{ {
while(isdigit(*p)) n = n * 10 + *p++ - '0'; while(isdigit(*p)) n = n * 10 + *p++ - '0';
getstrings |= 1 << n; getstrings |= 1U << n;
} }
else if (isalnum(*p)) else if (isalnum(*p))
{ {
READ_CAPTURE_NAME(p, &gn8ptr, &gn16ptr, &gn32ptr, re); READ_CAPTURE_NAME(p, &gn8ptr, &gn16ptr, &gn32ptr, re);
} }
continue; continue;
case 'J': case 'J':
while(isdigit(*p)) n = n * 10 + *p++ - '0'; while(isdigit(*p)) n = n * 10 + *p++ - '0';
if (extra != NULL if (extra != NULL
skipping to change at line 5277 skipping to change at line 5277
if (markptr != NULL) if (markptr != NULL)
{ {
fprintf(outfile, "MK: "); fprintf(outfile, "MK: ");
PCHARSV(markptr, 0, -1, outfile); PCHARSV(markptr, 0, -1, outfile);
fprintf(outfile, "\n"); fprintf(outfile, "\n");
} }
for (i = 0; i < 32; i++) for (i = 0; i < 32; i++)
{ {
if ((copystrings & (1 << i)) != 0) if ((copystrings & (1U << i)) != 0)
{ {
int rc; int rc;
char copybuffer[256]; char copybuffer[256];
PCRE_COPY_SUBSTRING(rc, bptr, use_offsets, count, i, PCRE_COPY_SUBSTRING(rc, bptr, use_offsets, count, i,
copybuffer, sizeof(copybuffer)); copybuffer, sizeof(copybuffer));
if (rc < 0) if (rc < 0)
fprintf(outfile, "copy substring %d failed %d\n", i, rc); fprintf(outfile, "copy substring %d failed %d\n", i, rc);
else else
{ {
fprintf(outfile, "%2dC ", i); fprintf(outfile, "%2dC ", i);
skipping to change at line 5342 skipping to change at line 5342
fprintf(outfile, " (%d) ", rc); fprintf(outfile, " (%d) ", rc);
PCHARSV(cnptr, 0, -1, outfile); PCHARSV(cnptr, 0, -1, outfile);
putc('\n', outfile); putc('\n', outfile);
} }
cnptr = (char *)cnptr + (STRLEN(cnptr) + 1) * CHAR_SIZE; cnptr = (char *)cnptr + (STRLEN(cnptr) + 1) * CHAR_SIZE;
} }
for (i = 0; i < 32; i++) for (i = 0; i < 32; i++)
{ {
if ((getstrings & (1 << i)) != 0) if ((getstrings & (1U << i)) != 0)
{ {
int rc; int rc;
const char *substring; const char *substring;
PCRE_GET_SUBSTRING(rc, bptr, use_offsets, count, i, &substring); PCRE_GET_SUBSTRING(rc, bptr, use_offsets, count, i, &substring);
if (rc < 0) if (rc < 0)
fprintf(outfile, "get substring %d failed %d\n", i, rc); fprintf(outfile, "get substring %d failed %d\n", i, rc);
else else
{ {
fprintf(outfile, "%2dG ", i); fprintf(outfile, "%2dG ", i);
PCHARSV(substring, 0, rc, outfile); PCHARSV(substring, 0, rc, outfile);
 End of changes. 6 change blocks. 
6 lines changed or deleted 6 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)