diff --git a/global-functions.rsc b/global-functions.rsc index 226fedbb..e6638154 100644 --- a/global-functions.rsc +++ b/global-functions.rsc @@ -710,14 +710,11 @@ } :do { - # Do *NOT* try :deserialize here to split lines. It can fail with - # scripts, and it *does* fail with global-functions! - :local Len [ :find $Input "\n" ]; - :local Line [ :pick $Input 0 $Len ]; + :local Line [ :pick $Input 0 [ :find $Input "\n" ] ]; :if ([ :typeof [ :find $Line $Pattern ] ] = "num") do={ :return $Line; } - :set Input [ :pick $Input ($Len + 1) [ :len $Input ] ]; + :set Input [ :pick $Input ([ :find $Input "\n" ] + 1) [ :len $Input ] ]; } while=([ :len $Input ] > 0); :return [];