about summary refs log tree commit diff
path: root/tvix/eval/src/builtins
diff options
context:
space:
mode:
authorLinus Heckemann <git@sphalerite.org>2023-08-24T00·14+0200
committerLinus Heckemann <git@sphalerite.org>2023-08-24T10·07+0000
commita3dbb60213fad39f73f6a03fb5e14eaa09b85670 (patch)
treeadef67551d4046e65618d2fb4e7bf7f6aef79be4 /tvix/eval/src/builtins
parente9bbc5f2af35c9c303a20adfa3c805eb13db767f (diff)
fix(tvix/eval): off-by-one in replaceStrings r/6523
replaceStrings would previously fail to replace the last character
in a string.

Change-Id: I43a7c960945350b2e7a5b731b7fdb617723eb38f
Reviewed-on: https://cl.tvl.fyi/c/depot/+/9151
Tested-by: BuildkiteCI
Reviewed-by: sterni <sternenseemann@systemli.org>
Diffstat (limited to 'tvix/eval/src/builtins')
-rw-r--r--tvix/eval/src/builtins/mod.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/tvix/eval/src/builtins/mod.rs b/tvix/eval/src/builtins/mod.rs
index d0c5bf5568b9..d701fa08a08d 100644
--- a/tvix/eval/src/builtins/mod.rs
+++ b/tvix/eval/src/builtins/mod.rs
@@ -723,7 +723,7 @@ mod pure_builtins {
                 let from = elem.0.to_str()?;
                 let to = elem.1.to_str()?;
 
-                if i + from.len() >= string.len() {
+                if i + from.len() > string.len() {
                     continue;
                 }