diff --git a/perltest.sh b/perltest.sh index 37d45119e..65031ce83 100755 --- a/perltest.sh +++ b/perltest.sh @@ -118,9 +118,10 @@ fi # already have. NOTE: this is different to pcre2test where #pattern sets # defaults which can be overridden on individual patterns. The #subject command # may be used to set or unset a default "mark" modifier for data lines. This is -# the only use of #subject that is supported. The #perltest, #forbid_utf, and -# #newline_default commands, which are needed in the relevant pcre2test files, -# are ignored. Any other #-command is ignored, with a warning message. +# the only use of #subject that is supported. The #perltest, #forbid_utf, +# #newline_default, and #if...#endif commands, which are needed in the relevant +# pcre2test files, are ignored. Any other #-command is ignored, with a warning +# message. # # The pattern lines should use only / as the delimiter. The other characters # that pcre2test supports cause problems with this script. @@ -247,7 +248,7 @@ for (;;) } elsif ($_ =~ /^#/) { - if ($_ !~ /^#newline_default|^#perltest|^#forbid_utf/) + if ($_ !~ /^#newline_default|^#perltest|^#forbid_utf|^#if|^#endif/) { printf $outfile "** Warning: #-command ignored: %s", $_; } diff --git a/src/pcre2test.c b/src/pcre2test.c index 0c773fe0f..ce484bf27 100644 --- a/src/pcre2test.c +++ b/src/pcre2test.c @@ -5417,12 +5417,15 @@ switch(cmd) for (i = 0; i < COPTLISTCOUNT; i++) { size_t optlen = strlen(coptlist[i].name); - const char *argptr_trail; - if (coptlist[i].type != CONF_FIX) continue; - if (strncmp(argptr, coptlist[i].name, optlen) != 0) continue; + const uint8_t *argptr_trail; + if (coptlist[i].type != CONF_FIX) + continue; + if (strncmp((const char*)argptr, coptlist[i].name, optlen) != 0) + continue; argptr_trail = argptr + optlen; while (isspace(*argptr_trail)) argptr_trail++; - if (*argptr_trail == 0 || *argptr_trail == '\n') break; + if (*argptr_trail == 0 || *argptr_trail == '\n') + break; } if (i == COPTLISTCOUNT) { @@ -10126,7 +10129,7 @@ while (notdone) if (skipping_endif) { - if (strncmp(buffer, "#endif", 6) != 0 || + if (strncmp((char*)buffer, "#endif", 6) != 0 || !(buffer[6] == 0 || isspace(buffer[6]))) continue; skipping_endif = FALSE;