Skip to content

Commit

Permalink
Bring back FOO.BAR names
Browse files Browse the repository at this point in the history
  • Loading branch information
joho committed Feb 5, 2023
1 parent 631add6 commit 98e2598
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
2 changes: 0 additions & 2 deletions godotenv_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -400,8 +400,6 @@ func TestParsing(t *testing.T) {
parseAndCompare(t, `FOO="bar\\r\ b\az"`, "FOO", "bar\\r baz")

parseAndCompare(t, `="value"`, "", "value")
parseAndCompare(t, `KEY="`, "KEY", "\"")
parseAndCompare(t, `KEY="value`, "KEY", "\"value")

// unquoted whitespace around keys should be ignored
parseAndCompare(t, " KEY =value", "KEY", "value")
Expand Down
4 changes: 2 additions & 2 deletions parser.go
Original file line number Diff line number Diff line change
Expand Up @@ -101,8 +101,8 @@ loop:
break loop
case '_':
default:
// variable name should match [A-Za-z0-9_]
if unicode.IsLetter(rchar) || unicode.IsNumber(rchar) {
// variable name should match [A-Za-z0-9_.]
if unicode.IsLetter(rchar) || unicode.IsNumber(rchar) || rchar == '.' {
continue
}

Expand Down

0 comments on commit 98e2598

Please sign in to comment.