-
Notifications
You must be signed in to change notification settings - Fork 6.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[qt5-tools] Fix deploying translation files with windeployqt (#25134)
- Loading branch information
1 parent
a175d0a
commit 86bf362
Showing
5 changed files
with
33 additions
and
1 deletion.
There are no files selected for viewing
25 changes: 25 additions & 0 deletions
25
ports/qt5-tools/Fix-regression-in-lconvert-handling-empty-translations.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
diff --git a/src/linguist/shared/qm.cpp b/src/linguist/shared/qm.cpp | ||
index 8c3fc3f..d772855 100644 | ||
--- a/src/linguist/shared/qm.cpp | ||
+++ b/src/linguist/shared/qm.cpp | ||
@@ -552,12 +552,17 @@ bool loadQM(Translator &translator, QIODevice &dev, ConversionData &cd) | ||
goto end; | ||
case Tag_Translation: { | ||
int len = read32(m); | ||
- if (len & 1) { | ||
+ m += 4; | ||
+ | ||
+ // -1 indicates an empty string | ||
+ // Otherwise streaming format is UTF-16 -> 2 bytes per character | ||
+ if ((len != -1) && (len & 1)) { | ||
cd.appendError(QLatin1String("QM-Format error")); | ||
return false; | ||
} | ||
- m += 4; | ||
- QString str = QString((const QChar *)m, len/2); | ||
+ QString str; | ||
+ if (len != -1) | ||
+ str = QString((const QChar *)m, len / 2); | ||
if (QSysInfo::ByteOrder == QSysInfo::LittleEndian) { | ||
for (int i = 0; i < str.length(); ++i) | ||
str[i] = QChar((str.at(i).unicode() >> 8) + |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters