diff --git a/CONTRIBUTIONS.md b/CONTRIBUTIONS.md index 95e6307f..1bce0fa1 100644 --- a/CONTRIBUTIONS.md +++ b/CONTRIBUTIONS.md @@ -39,6 +39,7 @@ Add yourself to the list, * Andrea Ruffini Perico * Andrew Cox * Benjamin Newman +* Christian Werner * Christoph Boss (@Kampfwurst) * Daniel Ziegenberg (@ziegenberg) * Devin Dean (@dd2594gh) diff --git a/global-functions.rsc b/global-functions.rsc index 45bb24d3..d6be0781 100644 --- a/global-functions.rsc +++ b/global-functions.rsc @@ -726,11 +726,14 @@ } :do { - :local Line [ :pick $Input 0 [ :find $Input "\n" ] ]; + # 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 ]; :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 [];