Skip to content

Commit 096626a

Browse files
committed
regen/embed.pl: Don't meld words to get wrong results
@bram-perl found this example of how it could be broken before this commit: initial : $arg is "NULLOK NN SV *msg_sv after s//: $arg is "NULLOKSV *msg_sv
1 parent d462af1 commit 096626a

File tree

2 files changed

+10
-5
lines changed

2 files changed

+10
-5
lines changed

proto.h

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

regen/embed.pl

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -264,10 +264,15 @@ sub generate_proto_h {
264264
++$unflagged_pointers;
265265
}
266266

267-
my $nn = ( $arg =~ s/\s*\bNN\b\s+// );
268-
my $nz = ( $arg =~ s/\s*\bNZ\b\s+// );
269-
my $nullok = ( $arg =~ s/\s*\bNULLOK\b\s+// );
270-
my $nocheck = ( $arg =~ s/\s*\bNOCHECK\b\s+// );
267+
my $nn = ( $arg =~ s/\bNN\b// );
268+
my $nz = ( $arg =~ s/\bNZ\b// );
269+
my $nullok = ( $arg =~ s/\bNULLOK\b// );
270+
my $nocheck = ( $arg =~ s/\bNOCHECK\b// );
271+
272+
# Trim $arg and remove multiple blanks
273+
$arg =~ s/^\s+//;
274+
$arg =~ s/\s+$//;
275+
$arg =~ s/\s{2,}/ /g;
271276

272277
push( @nonnull, $n ) if $nn;
273278

0 commit comments

Comments
 (0)