rebol/r3 — pull request #111 by earl (2013-03-30 18:42:06+00:00)
Title: Fix TRIM bug with multiple lines

This is a slightly reduced version (without the unrelated post-increment to pre-increment changes) of a fix done by @CCX, originally submitted as pull request #76.

--

Example code exhibiting the bug:

>> trim " x ^/"
== "x x^/" ;; Expected: "x^/"

The fix changes some variable names, to make the algorithm easier to understand. head and tail are now trimmed first, because it is simpler this way.

This fixes CureCode issue #1948.