Non global substitution isn't done in two consecutive lines when the string on the 2nd line is before or at the same place of the first line. For example : ,s/OLD/NEW/ on -- OLD OLD -- gave -- OLD NEW -- (bug) but on -- OLD OLD -- gave -- NEW NEW -- (OK) and on -- OLD XXXOLD -- (OK) gave -- NEW XXXNEW -- (OK). On the first example, ,s/OLD/NEW/g works correctly (all OLD are substituted). Looking at the source of the 1.35 version (editors/ed.c), it seems that this problem can be corrected by initializing "offset = 0;" each time "lp = lp->next; num1++;" in the subCommand() function (so in line 729 and 770).
Please read -- NEW OLD -- instead the opposite for the erroneous behavior. Sorry.