Skip to content

Commit

Permalink
Small build fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
NWilson committed Jan 17, 2025
1 parent 2863c9e commit b1d55a2
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 8 deletions.
9 changes: 5 additions & 4 deletions perltest.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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", $_;
}
Expand Down
11 changes: 7 additions & 4 deletions src/pcre2test.c
Original file line number Diff line number Diff line change
Expand Up @@ -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(argptr, (const uint8_t *)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)
{
Expand Down

0 comments on commit b1d55a2

Please sign in to comment.