feature #2699: convert new lines to spaces in CONTEXT/FILES

(cherry picked from commit ef0b9546192f8bb3e6399924cbc6d0e2a4b2c2b8)
feature #2699: Fix index type in string loop

(cherry picked from commit e6fc3ec37a67ce0af6bc11e23db705c911b4b9d1)