From d54c283821e3350bf51e40954b747fb173746ae4 Mon Sep 17 00:00:00 2001 From: Philipp Otterbein Date: Sat, 28 Dec 2024 23:40:25 +0100 Subject: [PATCH] fix documentation of substring (cherry picked from commit 1e2cace5f1dbd55ed76afbad7519100b76af5d88) --- src/libexpr/primops.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/libexpr/primops.cc b/src/libexpr/primops.cc index 45d9f86ac..f98cc9073 100644 --- a/src/libexpr/primops.cc +++ b/src/libexpr/primops.cc @@ -4061,7 +4061,7 @@ static RegisterPrimOp primop_toString({ }); /* `substring start len str' returns the substring of `str' starting - at character position `min(start, stringLength str)' inclusive and + at byte position `min(start, stringLength str)' inclusive and ending at `min(start + len, stringLength str)'. `start' must be non-negative. */ static void prim_substring(EvalState & state, const PosIdx pos, Value * * args, Value & v) @@ -4100,7 +4100,7 @@ static RegisterPrimOp primop_substring({ .name = "__substring", .args = {"start", "len", "s"}, .doc = R"( - Return the substring of *s* from character position *start* + Return the substring of *s* from byte position *start* (zero-based) up to but not including *start + len*. If *start* is greater than the length of the string, an empty string is returned. If *start + len* lies beyond the end of the string or *len* is `-1`,