Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
no need to splice headers
  • Loading branch information
kraih committed Jan 10, 2015
1 parent 2ced6e6 commit f72acd3
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion Changes
@@ -1,5 +1,5 @@

5.72 2015-01-10
5.72 2015-01-11
- Added EXPERIMENTAL support for case-insensitive attribute selectors like
[foo="bar" i] to Mojo::DOM::CSS.
- Improved Mojo::Reactor::EV to update the current time before starting a
Expand Down
8 changes: 4 additions & 4 deletions lib/Mojo/Headers.pm
Expand Up @@ -96,15 +96,15 @@ sub parse {
}

# New header
if ($line =~ /^(\S[^:]*)\s*:\s*(.*)$/) { push @$headers, $1, $2 }
if ($line =~ /^(\S[^:]*)\s*:\s*(.*)$/) { push @$headers, [$1, $2] }

# Multiline
elsif (@$headers && $line =~ s/^\s+//) { $headers->[-1] .= " $line" }
elsif ($line =~ s/^\s+// && @$headers) { $headers->[-1][1] .= " $line" }

# Empty line
else {
$self->add(splice @$headers, 0, 2) while @$headers;
$self->{state} = 'finished';
$self->add(@$_) for @$headers;
@$self{qw(state cache)} = ('finished', []);
return $self;
}
}
Expand Down

0 comments on commit f72acd3

Please sign in to comment.