Use YAML block-literal syntax to avoid wrapped lines.

In vspeak(), andle text with extra trailing \n.
This commit is contained in:
Eric S. Raymond 2017-06-30 16:19:02 -04:00
parent 030fa6d27d
commit ba9e933f20
2 changed files with 528 additions and 130 deletions

5
misc.c
View file

@ -243,6 +243,11 @@ void vspeak(const char* msg, va_list ap)
}
*renderp = 0;
// Deal with messages that are in YAML block format and therefore
// have their own trailing \n
if (renderp > rendered && renderp[-1] == '\n')
*--renderp = '\0';
// Print the message.
printf("%s\n", rendered);