mirror of
https://github.com/prometheus/prometheus
synced 2024-12-26 16:43:21 +00:00
Merge pull request #767 from prometheus/fabxc/cr-fix
promql: fix lexing of \r as whitespaces
This commit is contained in:
commit
bc574a0d93
@ -724,7 +724,7 @@ Loop:
|
||||
}
|
||||
|
||||
func isSpace(r rune) bool {
|
||||
return r == ' ' || r == '\t' || r == '\n'
|
||||
return r == ' ' || r == '\t' || r == '\n' || r == '\r'
|
||||
}
|
||||
|
||||
// isEndOfLine reports whether r is an end-of-line character.
|
||||
|
@ -42,6 +42,9 @@ var tests = []struct {
|
||||
{itemDuration, 1, `5m`},
|
||||
{itemRightBracket, 3, `]`},
|
||||
},
|
||||
}, {
|
||||
input: "\r\n\r",
|
||||
expected: []item{},
|
||||
},
|
||||
// Test numbers.
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user