While reading the code, I realized that if an identifier name contained
the substring 'const' this wouldn't work. It's a simple matter to add
\b to prevent this unlikely scenario.
(cherry picked from commit
eaa9c034d31c5a167bf85b6888fed5201bf0667f)
Signed-off-by: Nicolas R <atoomic@cpan.org>
}
my($n, $p, $d) = $a =~ /^ (\w+(?:\s+\w+)*)\s* # type name => $n
(\**) # pointer => $p
- (?:\s*const\s*)? # const
+ (?:\s*\bconst\b\s*)? # const
((?:\[[^\]]*\])*) # dimension => $d
$/x
or die "$0 - cannot parse argument: [$a]\n";
next;
}
$n = $tmap{$n} || $n;
- if ($n eq 'const char' and $p eq '*' and !$f->{flags}{f}) {
+ if ($n =~ /\bconst\s+char\b/ and $p eq '*' and !$f->{flags}{f}) {
push @arg, '"foo"';
}
else {