#! /bin/sh /usr/share/dpatch/dpatch-run ## 02-no-unknown-char-context.dpatch by René van Bevern ## ## DP: There certainly isn't a context of 10 characters around every unknown ## DP: character in a string, this needs checking. @DPATCH@ --- albert-0.4.10/lisp2csf/cleaning.lisp 2005-06-15 18:49:13.000000000 +0200 +++ albertalt/lisp2csf/cleaning.lisp 2005-06-15 19:53:23.000000000 +0200 @@ -144,6 +144,14 @@ (t (warn "Unknown hash-char ~a [~a] [file: ~a ]" next-char (char-code next-char) fname) 2)))) + + (context (pos amount) + (let ((end (if (< (+ pos amount) (length the-string)) + (+ pos amount) nil)) + (start (if (> (- pos amount) 0) + (- pos amount) 0))) + (subseq the-string start end))) + ) @@ -174,7 +182,7 @@ (t (warn "Unknown char ~a [~a, pos: ~a, file: ~a ] {~a}" cur-char (char-code cur-char) - i fname (subseq the-string (- i 5) (+ i 5))) + i fname (context i 5)) )))