Copy-pasted some string-parsing from the Xboard-protocol