Self contained shell script that reproduces the problem. Tested on Ubuntu-10.04 with Fossil trunk.