Skip to content

Commit

Permalink
Parse continuous whitespace as whitespace
Browse files Browse the repository at this point in the history
Fixes error on parse of a line like below
I.e. two spaces before start of comment, comment contains quote char
A=1  #'
  • Loading branch information
carbsrule committed Jan 17, 2023
1 parent 127c0a4 commit 17b75c9
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions dotenv/src/iter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ fn eval_end_state(prev_state: ParseState, buf: &str) -> (usize, ParseState) {
cur_pos = pos;
cur_state = match cur_state {
ParseState::WhiteSpace => match c {
c if c.is_whitespace() && c != '\n' && c != '\r' => ParseState::WhiteSpace,
'#' => return (cur_pos, ParseState::Comment),
'\\' => ParseState::Escape,
'"' => ParseState::WeakOpen,
Expand Down

0 comments on commit 17b75c9

Please sign in to comment.