diff --git a/src/std/text.ab b/src/std/text.ab index 1d79401c..b93c0c37 100644 --- a/src/std/text.ab +++ b/src/std/text.ab @@ -13,9 +13,8 @@ pub fun replace(source, search, replace) { trust $ {nameof search}="\$\{{nameof search}//\\\\/\\\\\\\}" $ if bash_version() >= 502 { trust $ {nameof replace}="\$\{{nameof replace}//\\\\/\\\\\\\\}" $ - } else { - trust $ {nameof replace}="\$\{{nameof replace}//\\\\/\\\\}" $ } + return trust $ echo "\$\{{nameof source}//{search}/{replace}}" $ } diff --git a/src/tests/stdlib/text_replace.ab b/src/tests/stdlib/text_replace.ab index 94b2a957..5a49ea19 100644 --- a/src/tests/stdlib/text_replace.ab +++ b/src/tests/stdlib/text_replace.ab @@ -7,6 +7,7 @@ import * from "std/text" // mono // di // tri + main { echo replace("one one one", "one", "TWO") echo replace("a\\b\\c\\d", "\\", "\\\\")