From 36827777a3d21d5628096dafa33c2b71eb101248 Mon Sep 17 00:00:00 2001 From: Ludovic Court`es Date: Wed, 28 Mar 2007 08:14:32 +0000 Subject: `diff' package: Fixed off-by-one in string diff. * src/guile/skribilo/package/diff.scm (add-unchanged): When `(null? edits)', check whether `(< str-pos str-len)' (was `(< str-pos (- str-len 1))'). This fixes off-by-one when diffing strings (last character didn't appear). git-archimport-id: lcourtes@laas.fr--2006-libre/skribilo--devo--1.2--patch-36 --- src/guile/skribilo/package/diff.scm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/guile') diff --git a/src/guile/skribilo/package/diff.scm b/src/guile/skribilo/package/diff.scm index 7e9dc53..f3f6cba 100644 --- a/src/guile/skribilo/package/diff.scm +++ b/src/guile/skribilo/package/diff.scm @@ -145,7 +145,7 @@ (result '()) (str-pos 0)) (if (null? edits) - (reverse! (if (< str-pos (- str-len 1)) + (reverse! (if (< str-pos str-len) (cons (list 'unchanged str-pos (- str-len 1)) result) result)) -- cgit v1.2.3