3bd9f6db7a
Submitted by: Ikuo Nakagawa <ikuo@isl.intec.co.jp>, PR#1488, but using Bruce Evans <bde@zeta.org.au>'s fix.