rars
rars copied to clipboard
Improve readChar
readChar has various issues:
- it consumes a whole line of text, truncate it at the first character and lose what remain
- is not able to read newline character (it just aborts)
- also aborts on EOF
This PR proposes that:
- readChar reads the next byte in the input (run panel or stdin) and use it as the result
\nis not special and just return 10- return -1 (signed 32/64 bit) on EOF
The PR also add tests for readChar, readString and read