Skip to content

Commit 8a5a41b

Browse files
committed
php_mapi: refine error code selection from mapierr.hpp
Some ec* codes have no MAPI_* alias and so must be emitted as ec. Fixes: gromox-1.26-68-ga233bf025
1 parent 53c6970 commit 8a5a41b

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

tools/defs2php.pl

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,15 @@ sub proptag
3737

3838
sub errcode
3939
{
40-
my($aliases, $value) = ("$2 $4", $3);
41-
while ($aliases =~ m{\b([A-Z]{2}\w*_[WEX]_\w+)}g) {
42-
print "C($&, $value)\n";
40+
my($key, $value) = ($2, $3);
41+
my @aliases = "$2 $4" =~ m{\b([A-Z]{2}\w*_[WEX]_\w+)}g;
42+
if (scalar(@aliases) == 0 && defined($key) && substr($key, 0, 2) eq "ec") {
43+
# ec* is the only name available for $value
44+
print "C($key, $value)\n";
45+
return;
46+
}
47+
for my $a (@aliases) {
48+
print "C($a, $value)\n";
4349
}
4450
}
4551

0 commit comments

Comments
 (0)