summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Kaganski <mike.kaganski@collabora.com>2018-03-23 14:17:14 +0100
committerMike Kaganski <mike.kaganski@collabora.com>2018-03-23 16:58:29 +0100
commit2367557493c216be5b5e8156ba6493d440a10b0f (patch)
treeb4fba0070816723e1de08052d7a42f2493cd6fe1
parent8789f4f65b1a9df55862557ae65d9267fcd8a986 (diff)
tdf#116581: also read UTF16-encoded version string from TTF
Change-Id: I47d8a755450b085be39346615f06cee4f920859f Reviewed-on: https://gerrit.libreoffice.org/51781 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
-rw-r--r--solenv/bin/modules/installer/windows/file.pm7
1 files changed, 7 insertions, 0 deletions
diff --git a/solenv/bin/modules/installer/windows/file.pm b/solenv/bin/modules/installer/windows/file.pm
index 1a12becb6076..76217f859b45 100644
--- a/solenv/bin/modules/installer/windows/file.pm
+++ b/solenv/bin/modules/installer/windows/file.pm
@@ -560,12 +560,19 @@ sub get_fileversion
close TTF;
my $ttfversion = "(Version )([0-9]+[.]*([0-9][.])*[0-9]+)";
+ # UTF16-encoded version string
+ my $ttfversionU = "(V\0e\0r\0s\0i\0o\0n\0 \0)(([0-9]\0)+([.]\0([0-9]\0)+)*)";
if ($ttfdata =~ /$ttfversion/ms)
{
my ($version, $subversion, $microversion, $vervariant) = split(/\./,$2);
$fileversion = int($version) . "." . int($subversion) . "." . int($microversion) . "." . int($vervariant);
}
+ elsif ($ttfdata =~ /$ttfversionU/ms)
+ {
+ my ($version, $subversion, $microversion, $vervariant) = split(/\./,$2 =~ s/\0//gr);
+ $fileversion = int($version) . "." . int($subversion) . "." . int($microversion) . "." . int($vervariant);
+ }
else
{
$fileversion = "1.0.0.0";