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 f568c99 commit 27959f3
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
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
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 27959f3

Please sign in to comment.