Merge pull request #3 from ams-hash/crash_bug_fix
Fixed bug where it crashed if no input was entered
This commit is contained in:
commit
7467ba380c
|
@ -22,6 +22,10 @@ fn main() {
|
||||||
let mut previous_command = None;
|
let mut previous_command = None;
|
||||||
|
|
||||||
while let Some(command) = commands.next() {
|
while let Some(command) = commands.next() {
|
||||||
|
if command.is_empty() {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
// everything after the first whitespace character is interpreted as args to the command
|
// everything after the first whitespace character is interpreted as args to the command
|
||||||
let mut parts = command.trim().split_whitespace();
|
let mut parts = command.trim().split_whitespace();
|
||||||
let command = parts.next().unwrap();
|
let command = parts.next().unwrap();
|
||||||
|
|
Loading…
Reference in a new issue