From ef3c56816a4df0e463dcb7cbe1a76fdec5397c49 Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Wed, 25 May 2022 15:54:26 -0700 Subject: [PATCH] Fix two consecutive matches --- shared-module/dotenv/__init__.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/shared-module/dotenv/__init__.c b/shared-module/dotenv/__init__.c index a7d0f9ba0d..bd1973366d 100644 --- a/shared-module/dotenv/__init__.c +++ b/shared-module/dotenv/__init__.c @@ -162,6 +162,10 @@ STATIC mp_int_t read_value(FIL *active_file, char *value, size_t value_len) { } // Unquoted values are ended by a newline or comment. if (!quoted && (character == '\n' || character == '#')) { + if (character == '\n') { + // Rewind one so the next_line can find the \n. + f_lseek(active_file, f_tell(active_file) - 1); + } break; } if (!quoted && unichar_isspace(character)) {