Skip to content

Commit

Permalink
Compliance to Arduino build CI workflow pipeline.
Browse files Browse the repository at this point in the history
  • Loading branch information
nthnn committed Apr 10, 2024
1 parent 3460174 commit 8218f84
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/rishka_syscalls.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -280,16 +280,16 @@ long RishkaSyscall::Sys::randomImpl() {

bool RishkaSyscall::Sys::changeDir(RishkaVM* vm) {
auto dir = vm->getPointerParam<char*>(0);
if(dir == "~") {
vm->setWorkingDirectory(F("/"));
if(strcmp(dir, "~") == 0) {
vm->setWorkingDirectory("/");
return true;
}

dir = rishka_sanitize_path(vm->getWorkingDirectory(), dir);
if(!SD.exists(dir))
String target = rishka_sanitize_path(vm->getWorkingDirectory(), String(dir));
if(!SD.exists(target))
return false;

vm->setWorkingDirectory(dir);
vm->setWorkingDirectory(target);
return true;
}

Expand Down

0 comments on commit 8218f84

Please sign in to comment.