In case anyone else encounters this, the problem was with ftp program (i’m using leapFTP 3) converting all newlines from <LF> to <CR>. I guess you shouldn’t use ascii transfer for php files…
Why 2.9.1? Updating WordPress would have erased all corrections to core files, and since i’m not the one who made them, i wouldn’t be able to restore them…