spaces would be handled properly fixes PR bin/25345 by Arto Selonen
Much nicer than the old one, if I may say so. Thanks go to atatat for testing and suggestions.