From: Steinar H. Gunderson Date: Sun, 14 Jan 2018 11:20:15 +0000 (+0100) Subject: Backport a JSON_delta fix that would cause deletions to go in the wrong order, causin... X-Git-Url: https://git.sesse.net/?p=remoteglot;a=commitdiff_plain;h=ace6e885e3ee17923c618e68d487e7631dc34553 Backport a JSON_delta fix that would cause deletions to go in the wrong order, causing corrupted diffs. --- diff --git a/www/js/json_delta.js b/www/js/json_delta.js index dad457b..91b17e1 100644 --- a/www/js/json_delta.js +++ b/www/js/json_delta.js @@ -76,7 +76,7 @@ JSON_delta = { if (diff.length == 0) {return [[], diff]} diff.sort(function (a,b) {return b.length-a.length}); for (idx in diff) { - if (diff[idx] > 1) {break} + if (diff[idx].length === 1) {break} } return [diff.slice(0,idx), diff.slice(idx)] },