From 80843373ba2e944b4b3b76d01264cbdfe70588ef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arne=20D=C3=B6ring?= Date: Wed, 31 Oct 2018 14:29:40 +0100 Subject: [PATCH] changelog entry --- changelog.md | 2 ++ lib/pure/strutils.nim | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/changelog.md b/changelog.md index 21b7b16a07..10c6663126 100644 --- a/changelog.md +++ b/changelog.md @@ -55,6 +55,8 @@ proc enumToString*(enums: openArray[enum]): string = slightly. The `dumpLisp` macro in this module now outputs an indented proper Lisp, devoid of commas. +- In `strutils` empty strings now no longer matched as substrings anymore. + ### Language additions - Vm suport for float32<->int32 and float64<->int64 casts was added. diff --git a/lib/pure/strutils.nim b/lib/pure/strutils.nim index 1285f0e1c4..d3d2fe8a07 100644 --- a/lib/pure/strutils.nim +++ b/lib/pure/strutils.nim @@ -2614,7 +2614,7 @@ when isMainModule: doAssert "-lda-ldz -ld abc".replaceWord("-ld") == "-lda-ldz abc" doAssert "-lda-ldz -ld abc".replaceWord("") == "-lda-ldz -ld abc" - doAssert "oo".replace("", "abc") == "abcoabcoabc" + doAssert "oo".replace("", "abc") == "oo" type MyEnum = enum enA, enB, enC, enuD, enE doAssert parseEnum[MyEnum]("enu_D") == enuD