summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
authorSteve Hay <steve.m.hay@googlemail.com>2014-09-24 09:13:26 +0100
committerSteve Hay <steve.m.hay@googlemail.com>2014-09-25 08:29:37 +0100
commitcc192ed19bd1c52dd1711a900ce276043ce418ae (patch)
tree2c81a6f4328d1babb3414ff5ec4dbd81d67d7c4c /ext
parent2d4a3ccef465111dae0e5e71cf008e97efeb057c (diff)
downloadperl-cc192ed19bd1c52dd1711a900ce276043ce418ae.tar.gz
Errno parsing: Skip expressions containing function names etc
Expressions containing a function name are no more eval()able than expressions which are just a function name, so skip them too. This also picks up on text in the expression and stops eval()s from whining about "String found where operator expected" on Win32 (with VC10) on expressions like L"\\Enlistment\\" and (sizeof(L"\\Enlistment\\")+(38*sizeof(WCHAR))), encountered when parsing ENLISTMENT_OBJECT_PATH and ENLISTMENT_OBJECT_NAME_LENGTH_IN_BYTES respectively.
Diffstat (limited to 'ext')
-rw-r--r--ext/Errno/Errno_pm.PL2
1 files changed, 1 insertions, 1 deletions
diff --git a/ext/Errno/Errno_pm.PL b/ext/Errno/Errno_pm.PL
index 1a75fcb287..22313e9249 100644
--- a/ext/Errno/Errno_pm.PL
+++ b/ext/Errno/Errno_pm.PL
@@ -247,7 +247,7 @@ sub write_errno_pm {
next if $name eq $expr;
$expr =~ s/\(?\(\s*[a-z_]\w*\s*\)\(?([^\)]+)\)?\)?/$1/i; # ((type)0xcafebabe) at alia
$expr =~ s/\b((?:0x)?[0-9a-f]+)[LU]+\b/$1/gi; # 2147483647L et alia
- next if $expr =~ m/^[a-z_]+$/i; # skip function names
+ next if $expr =~ m/\b[a-z_]\w*\b/i; # skip expressions containing function names etc
if($expr =~ m/^0[xX]/) {
$err{$name} = hex $expr;
}