Closed nicqrocks closed 8 years ago
Great catch! Thanks :-)
The code that's being patched (not the patch) looks absolutely awful. Even with the patch it doesn't word wrap to a given line length (which is supposedly its purpose) and I see routine and variable names that are stellar examples of how to be utterly confusing. And this is supposed to have pedagogic merit! I have to run right now but hope to be more specific or write a better version later today.
Yeah… this code is awful indeed. @raiph++
Nevertheless, with the patch at least the input text is reproduced (modulo trailing whitespace): the old version deleted input content in certain situations. However, I wholeheartedly agree: the code needs a cleanup.
This would originally skip the last word in the line without printing it to the next line. In other words, large lines of text would loose a word when it moved to the next line.