mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-08 10:44:56 +00:00
Bug 1248352 - Allow shell option parsing code to handle help text containing blank lines r=jandem
This commit is contained in:
parent
fac88e025d
commit
eb986dbae4
@ -95,7 +95,7 @@ PrintParagraph(const char* text, unsigned startColno, const unsigned limitColno,
|
||||
++it;
|
||||
|
||||
while (*it != '\0') {
|
||||
MOZ_ASSERT(!isspace(*it));
|
||||
MOZ_ASSERT(!isspace(*it) || *it == '\n');
|
||||
|
||||
/* Delimit the current token. */
|
||||
const char* limit = it;
|
||||
@ -106,9 +106,7 @@ PrintParagraph(const char* text, unsigned startColno, const unsigned limitColno,
|
||||
* If the current token is longer than the available number of columns,
|
||||
* then make a line break before printing the token.
|
||||
*/
|
||||
MOZ_ASSERT(limit - it > 0);
|
||||
size_t tokLen = limit - it;
|
||||
MOZ_ASSERT(tokLen);
|
||||
if (tokLen + colno >= limitColno) {
|
||||
printf("\n%*s%.*s", startColno + indent, "", int(tokLen), it);
|
||||
colno = startColno + tokLen;
|
||||
|
Loading…
Reference in New Issue
Block a user