From 740d652f2dcdc168bc2917279fb86ca83970da3c Mon Sep 17 00:00:00 2001 From: Hannah von Reth Date: Thu, 4 Nov 2021 16:16:48 +0100 Subject: [PATCH] Fix internal mimetypes db on Windows when compressed by an external tool Ensure to use binary encoding when handling the output of the compression tool. With out this change \r are dropped and the compressed file is corrupted. Change-Id: Iaf9b1fc015a376682f793aff079f45d03b201aec Reviewed-by: Thiago Macieira --- src/corelib/mimetypes/mime/generate.pl | 1 + 1 file changed, 1 insertion(+) diff --git a/src/corelib/mimetypes/mime/generate.pl b/src/corelib/mimetypes/mime/generate.pl index 4f2d7d5f2bf..c2f96c3dd68 100644 --- a/src/corelib/mimetypes/mime/generate.pl +++ b/src/corelib/mimetypes/mime/generate.pl @@ -81,6 +81,7 @@ if (checkCommand("xmlstarlet")) { if ($cmd) { # Run the command and read everything open CMD, "$cmd |"; + binmode CMD; $data = ; close CMD; die("Failed to run $cmd") if ($? >> 8);