Permalink
Browse files

correcting offset error

  • Loading branch information...
Danny Yoo
Danny Yoo committed Sep 4, 2011
1 parent c96dae3 commit 93a1987537db72a53040d34eaf6a846c9af05934
Showing with 2 additions and 2 deletions.
  1. +2 −2 private/command.rkt
View
@@ -117,15 +117,15 @@
;; are eaten in the process.
(define (wrap-to-count str n)
(cond
- [(< (string-length str) n) (list str)]
+ [(<= (string-length str) n) (list str)]
[(regexp-match-positions #rx"\n" str 0 n)
=>
(λ (posn)
(let-values ([(x y) (values (car (car posn)) (cdr (car posn)))])
(cons (substring str 0 x) (wrap-to-count (substring str y) n))))]
[else
;; iterate backwards from char n looking for a good break
- (let loop ([k (sub1 n)])
+ (let loop ([k n])
(cond
[(= k 0) (error wrap-to-count "could not break string")]
[(char=? (string-ref str k) #\space)

0 comments on commit 93a1987

Please sign in to comment.