| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent fd2a3ce commit e3a6384
3 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -142,7 +142,7 @@ void Dotenv::ParseLine(const std::string_view line) { | |||
| 142 | 142 | auto quote_character = value[quotation_index]; | |
| 143 | 143 | value.erase(0, 1); | |
| 144 | 144 | ||
| 145 | - auto end_quotation_index = value.find_last_of(quote_character); | ||
| 145 | + auto end_quotation_index = value.find(quote_character); | ||
| 146 | 146 | ||
| 147 | 147 | // We couldn't find the closing quotation character. Terminate. | |
| 148 | 148 | if (end_quotation_index == std::string::npos) { | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -33,3 +33,4 @@ RETAIN_INNER_QUOTES_AS_BACKTICKS=`{"foo": "bar's"}` | |||
| 33 | 33 | TRIM_SPACE_FROM_UNQUOTED= some spaced out string | |
| 34 | 34 | EMAIL=therealnerdybeast@example.tld | |
| 35 | 35 | SPACED_KEY = parsed | |
| 36 | + EDGE_CASE_INLINE_COMMENTS="VALUE1" # or "VALUE2" or "VALUE3" | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -68,3 +68,5 @@ assert.strictEqual(process.env.TRIM_SPACE_FROM_UNQUOTED, 'some spaced out string | |||
| 68 | 68 | assert.strictEqual(process.env.EMAIL, 'therealnerdybeast@example.tld'); | |
| 69 | 69 | // Parses keys and values surrounded by spaces | |
| 70 | 70 | assert.strictEqual(process.env.SPACED_KEY, 'parsed'); | |
| 71 | + // Parse inline comments correctly when multiple quotes | ||
| 72 | + assert.strictEqual(process.env.EDGE_CASE_INLINE_COMMENTS, 'VALUE1'); | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments