The file in question had been back and forwards between work and home via a windows machine. In transit it picked up \n\r at the end of line, rather than just \n. Removing the redundant \r characters fixed the problem. Still a bug IMHO. -- Fools ignore complexity. Pragmatists suffer it. Some can avoid it. Geniuses remove it.