Skip to content

Commit babd2de

Browse files
authored
Merge pull request #8296 from pypewpew/reset-cwd
Reset cwd before looking for files to run
2 parents d0f313c + 1a47c5f commit babd2de

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

main.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,8 @@
6868
#include "shared-bindings/microcontroller/Processor.h"
6969
#include "shared-bindings/supervisor/Runtime.h"
7070

71+
#include "shared-bindings/os/__init__.h"
72+
7173
#if CIRCUITPY_ALARM
7274
#include "shared-bindings/alarm/__init__.h"
7375
#endif
@@ -434,6 +436,9 @@ STATIC bool run_code_py(safe_mode_t safe_mode, bool *simulate_reset) {
434436
usb_setup_with_vm();
435437
#endif
436438

439+
// Make sure we are in the root directory before looking at files.
440+
common_hal_os_chdir("/");
441+
437442
// Check if a different run file has been allocated
438443
if (next_code_allocation) {
439444
next_code_info_t *info = ((next_code_info_t *)next_code_allocation->ptr);

0 commit comments

Comments
 (0)