Skip to content

Commit

Permalink
Improved program binary file loading on RishkaVM.
Browse files Browse the repository at this point in the history
  • Loading branch information
nthnn committed May 13, 2024
1 parent ca1a723 commit 4959753
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/rishka_vm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,13 @@ char* RishkaVM::getArgValue(const uint8_t index) const {
}

bool RishkaVM::loadFile(const char* fileName) {
File file = SD.open(fileName);
String absoluteFilename = "/bin/" + String(fileName) + ".bin";
if(!SD.exists(absoluteFilename))
absoluteFilename = rishka_sanitize_path(
this->getWorkingDirectory(),
(char*) fileName);

File file = SD.open(absoluteFilename);
if(!file) {
file.close();
return false;
Expand Down

0 comments on commit 4959753

Please sign in to comment.