From c887f93f9d03c5d125f319a4322e94615be456d9 Mon Sep 17 00:00:00 2001 From: Karl Williamson Date: Thu, 29 Dec 2011 21:54:42 -0700 Subject: [PATCH] Unicode::UCD: Allow prop_invmap() to work on non-compact binary properties It may be that the tables input to prop_invmap() are not in the most compact form. There was a problem coping with these on binary properties; which this commit fixes by realizing that a binary property omits its 'Y' property value. The .t does not pass these tests when the input is not compact, though. --- lib/Unicode/UCD.pm | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/Unicode/UCD.pm b/lib/Unicode/UCD.pm index b5d57e5..db95111 100644 --- a/lib/Unicode/UCD.pm +++ b/lib/Unicode/UCD.pm @@ -2818,7 +2818,10 @@ RETRY: # We now see that it should be # 12 => XYZ # 18 => $missing - if (@invlist > 1 && $invmap[-2] eq $map) { + if (@invlist > 1 && ( (defined $map) + ? $invmap[-2] eq $map + : $invmap[-2] eq 'Y')) + { $invlist[-1] = $end + 1; next; } -- 2.7.4