make more tests green

This commit is contained in:
Andreas Rumpf 2018-04-30 02:52:58 +02:00
commit 0fad659bf7
9 changed files with 36 additions and 33 deletions

View file

@ -190,11 +190,11 @@ proc len*(headers: HttpHeaders): int = return headers.table.len
proc parseList(line: string, list: var seq[string], start: int): int =
var i = 0
var current = ""
while line[start + i] notin {'\c', '\l', '\0'}:
while start+i < line.len and line[start + i] notin {'\c', '\l'}:
i += line.skipWhitespace(start + i)
i += line.parseUntil(current, {'\c', '\l', ','}, start + i)
list.add(current)
if line[start + i] == ',':
if start+i < line.len and line[start + i] == ',':
i.inc # Skip ,
current.setLen(0)