Skip to content

Commit 1a47c5f

Browse files
committed
Reset cwd before looking for files to run
Make sure we only look for the files in the root directory.
1 parent fc13fba commit 1a47c5f

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
@@ -408,6 +410,9 @@ STATIC bool run_code_py(safe_mode_t safe_mode, bool *simulate_reset) {
408410
usb_setup_with_vm();
409411
#endif
410412

413+
// Make sure we are in the root directory before looking at files.
414+
common_hal_os_chdir("/");
415+
411416
// Check if a different run file has been allocated
412417
if (next_code_allocation) {
413418
next_code_info_t *info = ((next_code_info_t *)next_code_allocation->ptr);

0 commit comments

Comments
 (0)