Merge pull request #8296 from pypewpew/reset-cwd

Reset cwd before looking for files to run
This commit is contained in:
Dan Halbert 2023-08-18 17:36:24 -04:00 committed by GitHub
commit babd2dec45
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

5
main.c
View File

@ -68,6 +68,8 @@
#include "shared-bindings/microcontroller/Processor.h"
#include "shared-bindings/supervisor/Runtime.h"
#include "shared-bindings/os/__init__.h"
#if CIRCUITPY_ALARM
#include "shared-bindings/alarm/__init__.h"
#endif
@ -434,6 +436,9 @@ STATIC bool run_code_py(safe_mode_t safe_mode, bool *simulate_reset) {
usb_setup_with_vm();
#endif
// Make sure we are in the root directory before looking at files.
common_hal_os_chdir("/");
// Check if a different run file has been allocated
if (next_code_allocation) {
next_code_info_t *info = ((next_code_info_t *)next_code_allocation->ptr);