I've been sitting on this for a few months expecting to finish it, but still haven't found the time, so I'm just putting it out there now so it isn't lost entirely. It's originally from Chandrakumar Muthaiah: http://article.gmane.org/gmane.comp.gnu.coreutils.bugs/15684 I applied it to the latest git, added some tests, and cleaned it up a bit.