Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix EOF behavior in interactive mode with history
Previously, EOF would re-process the previous line, read one more line, then exit. This is because bc_history_line left the buffer untouched in case of EOF, and the bc_vm_stdin loop reads the next line before checking the `done` condition of the previous iteration. This fix also prevents reading past the end of the buffer if the first user input is EOF, since in that case vec->len is still 0, so (size_t)-1 is passed to bc_read_binary.
- Loading branch information
1 parent
63031c6
commit f2bb38c
Showing
2 changed files
with
4 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
f2bb38c
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am currently on vacation. Sorry about that.
Will review when I get home.