Fix incorrect parsing of quit commands.

This commit is contained in:
2026-08-10 20:38:57 +01:00
parent c077ba2dc8
commit cc5d475ab8
+6
View File
@@ -51,10 +51,16 @@ Command BEd::parse(std::string cmd, bool eof) {
switch (cmd[i]) {
case 'q':
command.type = Command::Type::Quit;
skip_space();
if (i >= cmd.size())
return command;
throw bed_error("Invalid command.");
case 'Q':
command.type = Command::Type::ForceQuit;
skip_space();
if (i >= cmd.size())
return command;
throw bed_error("Invalid command.");
case 'p':
command.type = Command::Type::Print;
i++;