From 09e6846135caff201c2d32509ceb7ffeb31cceea Mon Sep 17 00:00:00 2001 From: Christian Walther Date: Mon, 2 Aug 2021 23:38:23 +0200 Subject: [PATCH] Fix empty boot_out.txt A pointer to the FIL structure was kept after it went out of scope. Apparently this happened to work until cf97793 added the `result` variable that clobbered it. Fixes #5062 --- main.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/main.c b/main.c index 13caf4beb7..3904268ba4 100755 --- a/main.c +++ b/main.c @@ -633,11 +633,13 @@ STATIC void __attribute__ ((noinline)) run_boot_py(safe_mode_t safe_mode) { static const char * const boot_py_filenames[] = STRING_LIST("boot.py", "boot.txt"); bool skip_boot_output = false; + #ifdef CIRCUITPY_BOOT_OUTPUT_FILE + FIL file_pointer; + #endif if (ok_to_run) { #ifdef CIRCUITPY_BOOT_OUTPUT_FILE - FIL file_pointer; boot_output_file = &file_pointer; // Get the base filesystem.