Skip to content

Commit

Permalink
Bug 1790873 - Send a full line at a time to printf_stderr in nsUniscr…
Browse files Browse the repository at this point in the history
…ibeBreaker.cpp r=bobowen

Differential Revision: https://phabricator.services.mozilla.com/D166852
  • Loading branch information
hotsphink committed Jan 11, 2024
1 parent 46aea38 commit 86e7e76
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions intl/lwbrk/nsUniscribeBreaker.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -126,20 +126,20 @@ void NS_GetComplexLineBreaks(const char16_t* aText, uint32_t aLength,
}

if (mismatch) {
nsCString line("uniscribe: ");
// The logging here doesn't handle surrogates, but we only have tests using
// Thai currently, which is BMP-only.
printf_stderr("uniscribe: ");
for (uint32_t i = 0; i < aLength; ++i) {
if (aBreakBefore[i]) printf_stderr("#");
printf_stderr("%s", NS_ConvertUTF16toUTF8(aText + i, 1).get());
if (aBreakBefore[i]) line.Append('#');
line.Append(NS_ConvertUTF16toUTF8(aText + i, 1).get());
}
printf_stderr("\n");
printf_stderr("brokered : ");
printf_stderr("%s\n", line.get());
line.Assign("brokered : ");
for (uint32_t i = 0; i < aLength; ++i) {
if (brokeredBreaks[i]) printf_stderr("#");
printf_stderr("%s", NS_ConvertUTF16toUTF8(aText + i, 1).get());
if (brokeredBreaks[i]) line.Append('#');
line.Append(NS_ConvertUTF16toUTF8(aText + i, 1).get());
}
printf_stderr("\n");
printf_stderr("%s\n", line.get());
MOZ_CRASH("Brokered breaks did not match.");
}
#endif
Expand Down

0 comments on commit 86e7e76

Please sign in to comment.