mirror of
https://github.com/nim-lang/Nim.git
synced 2026-01-15 17:25:36 +00:00
Fixes for parseUntil when until.len == 0 (or nil)
This commit is contained in:
@@ -197,6 +197,9 @@ proc parseUntil*(s: string, token: var string, until: string,
|
||||
## parses a token and stores it in ``token``. Returns
|
||||
## the number of the parsed characters or 0 in case of an error. A token
|
||||
## consists of any character that comes before the `until` token.
|
||||
if until.len == 0:
|
||||
token.setLen(0)
|
||||
return 0
|
||||
var i = start
|
||||
while i < s.len:
|
||||
if s[i] == until[0]:
|
||||
|
||||
Reference in New Issue
Block a user