From 1af9ed26b7bfb3912bc71459c7975be042af7e4b Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Tue, 17 Feb 2026 12:14:43 +0100 Subject: [PATCH] global-functions: $Grep: use length from variable --- global-functions.rsc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/global-functions.rsc b/global-functions.rsc index 310ff99f..d6be0781 100644 --- a/global-functions.rsc +++ b/global-functions.rsc @@ -728,11 +728,12 @@ :do { # Do *NOT* try :deserialize here to split lines. It can fail with # scripts, and it *does* fail with global-functions! - :local Line [ :pick $Input 0 [ :find $Input "\n" ] ]; + :local Len [ :find $Input "\n" ]; + :local Line [ :pick $Input 0 $Len ]; :if ([ :typeof [ :find $Line $Pattern ] ] = "num") do={ :return $Line; } - :set Input [ :pick $Input ([ :find $Input "\n" ] + 1) [ :len $Input ] ]; + :set Input [ :pick $Input ($Len + 1) [ :len $Input ] ]; } while=([ :len $Input ] > 0); :return [];