summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorLudovic Court`es2007-03-28 08:14:32 +0000
committerLudovic Court`es2007-03-28 08:14:32 +0000
commit36827777a3d21d5628096dafa33c2b71eb101248 (patch)
tree29d2272c8953dc9c13ca28b3ee45379fcc5ff802 /src
parent0be8b41328f05aee4610b190b00b51d459e28395 (diff)
downloadskribilo-36827777a3d21d5628096dafa33c2b71eb101248.tar.gz
skribilo-36827777a3d21d5628096dafa33c2b71eb101248.tar.lz
skribilo-36827777a3d21d5628096dafa33c2b71eb101248.zip
`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
Diffstat (limited to 'src')
-rw-r--r--src/guile/skribilo/package/diff.scm2
1 files changed, 1 insertions, 1 deletions
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))