Skip to content

Commit

Permalink
Fixed RishkaVM::panic() and RishkaVM::loadFile() functionality.
Browse files Browse the repository at this point in the history
  • Loading branch information
nthnn committed May 13, 2024
1 parent 897048a commit 01f85ba
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/rishka_vm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,11 @@ bool RishkaVM::loadFile(const char* fileName) {
this->getWorkingDirectory(),
(char*) fileName);

if(!SD.exists(absoluteFilename))
absoluteFilename = rishka_sanitize_path(
this->getWorkingDirectory(),
(char*) (String(fileName) + ".bin").c_str());

if(!SD.exists(absoluteFilename))
return false;

Expand Down Expand Up @@ -103,6 +108,7 @@ void RishkaVM::panic(const char* message) {

this->stopVM();
this->reset();
this->setExitCode(-1);
}

void RishkaVM::reset() {
Expand Down

0 comments on commit 01f85ba

Please sign in to comment.