rtomayko/shocco — pull request #14 by rcrowley (2011-10-24 16:56:50+00:00)
Title: Properly order output when code0000 is empty

I spent a good bit of time learning this code trying to get to line up appropriately. Out-of-the-box it was putting the `set -e` line of code with the "File descriptor 3..." comment and continued off-by-one to the end.

The issue is that `csplit` ends up creating an empty `code0000` file in many cases, which, after much experimentation, just needs to signal `shocco` to reverse its reversed sort order, which is what this patch does.

It's been tested against a couple of my projects plus `shocco.sh` itself, where the problem was and no longer is exhibited.