Merge pull request #3 from ams-hash/crash_bug_fix

Fixed bug where it crashed if no input was entered
pull/4/head
Able 2021-11-06 20:33:27 -05:00 committed by GitHub
commit 67717ed8ed
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 0 deletions

View File

@ -22,6 +22,10 @@ fn main() {
let mut previous_command = None;
while let Some(command) = commands.next() {
if command.is_empty() {
continue;
}
// everything after the first whitespace character is interpreted as args to the command
let mut parts = command.trim().split_whitespace();
let command = parts.next().unwrap();