summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xtool/enc-unicode.rb3
1 files changed, 2 insertions, 1 deletions
diff --git a/tool/enc-unicode.rb b/tool/enc-unicode.rb
index d953014952..c5c593f617 100755
--- a/tool/enc-unicode.rb
+++ b/tool/enc-unicode.rb
@@ -535,6 +535,7 @@ if header
IO.popen([*NAME2CTYPE, out: tmp], "w") {|f| output.show(f, *syms)}
end while syms.pop
fds.each(&:close)
+ ff = nil
IO.popen(%W[diff -DUSE_UNICODE_AGE_PROPERTIES #{fds[1].path} #{fds[0].path}], "r") {|age|
IO.popen(%W[diff -DUSE_UNICODE_PROPERTIES #{fds[2].path} -], "r", in: age) {|f|
ansi = false
@@ -545,7 +546,7 @@ if header
line.sub!(/\/\*ANSI\*\//, '1') if ansi
line.gsub!(/\(int\)\((?:long|size_t)\)&\(\(struct uniname2ctype_pool_t \*\)0\)->uniname2ctype_pool_(str\d+),\s+/,
'uniname2ctype_offset(\1), ')
- if (/^(uniname2ctype_hash) /=~line)..(/^\}/=~line)
+ if ff = (!ff ? /^(uniname2ctype_hash) /=~line : /^\}/!~line) # no line can match both, exclusive flip-flop
line.sub!(/^( *(?:register\s+)?(.*\S)\s+hval\s*=\s*)(?=len;)/, '\1(\2)')
end
puts line