Reviewed and approved by Daniel Jacobowitz <drow@false.org>