diff --git a/src/rishka_vm.cpp b/src/rishka_vm.cpp index 38a8606..e66d8a0 100644 --- a/src/rishka_vm.cpp +++ b/src/rishka_vm.cpp @@ -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; @@ -103,6 +108,7 @@ void RishkaVM::panic(const char* message) { this->stopVM(); this->reset(); + this->setExitCode(-1); } void RishkaVM::reset() {