Import of cwm from OpenBSD 5.3.