diff --git a/lib/pure/parseutils.nim b/lib/pure/parseutils.nim index d77790fe02..d54f1454b1 100644 --- a/lib/pure/parseutils.nim +++ b/lib/pure/parseutils.nim @@ -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]: