composer/composer — pull request #398 by kostiklv (2012-03-06 21:17:49+00:00)
Title: Simplified & fixed ConsoleIO->overwrite

I've been getting garbage output on both linux & windows when composer tried to display downloading progress, so I've fixed ConsoleIO->overwrite. Main points:
* adjusted overwrite() to actually remember and overwrite LAST message as specified in OutputInterface phpDoc (instead of just backspacing 80 chars)
* replaced for loops with str_repeat - easier to read and faster
* strip and don't count inside messages when calculating back/white spaces
* account for case when $messages is an array (not used/tested, but may be useful later)
* removed extra blank line when downloading package (between 'Package x/y (v)' and 'Unpacking archive'

Tested on both linux & windows, UnitTests also updated and passing.