From 5a249d54d4b569fa99efc0fb3e22ff939ad6df87 Mon Sep 17 00:00:00 2001 From: demattia Date: Sun, 10 Oct 2004 13:19:55 +0000 Subject: [PATCH] fixed some minor bugs --- scheme/input-buffer.scm | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/scheme/input-buffer.scm b/scheme/input-buffer.scm index fcf6bd1..993a8cc 100644 --- a/scheme/input-buffer.scm +++ b/scheme/input-buffer.scm @@ -356,11 +356,13 @@ (lambda (num-cols pos-col line) (let* ((lines (ceiling (/ (string-length line) num-cols))) (end-pos (* lines num-cols))) - (let loop ((offset 0) - (end end-pos)) - (if (< (+ end 2) pos-col) - (- offset 1) - (loop (+ offset 1) (- end num-cols))))))) + (if (= (string-length line) 0) + 0 + (let loop ((offset 0) + (end end-pos)) + (if (<= (+ end 2) pos-col) + (- offset 1) + (loop (+ offset 1) (- end num-cols))))))))