fix `regexp-match' variants given a long string and an output port

... again; commit d194fa6245 turned out to be incomplete.
This commit is contained in:
Matthew Flatt 2013-02-04 18:04:31 -07:00
parent 2b7c6e32a9
commit 442f6eaaae
2 changed files with 11 additions and 10 deletions

View File

@ -1314,15 +1314,16 @@
;; unmatched output to a port:
(for ([succeed? '(#f #t)])
(for ([N '(1 100 1000 1023 1024 10000)])
(define o (open-output-bytes))
(void (regexp-match-positions #rx"y"
(string-append
(make-string N #\x)
(if succeed? "y" ""))
0
(+ N (if succeed? 1 0))
o))
(test N bytes-length (get-output-bytes o))))
(for ([M (list 0 (quotient N 2))])
(define o (open-output-bytes))
(void (regexp-match-positions #rx"y"
(string-append
(make-string N #\x)
(if succeed? "y" ""))
M
(+ N (if succeed? 1 0))
o))
(test (- N M) bytes-length (get-output-bytes o)))))
(arity-test regexp 1 1)
(arity-test regexp? 1 1)

View File

@ -5386,7 +5386,7 @@ static Scheme_Object *gen_compare(char *name, int pos,
if (lazy_string) {
full_s = lazy_string->s;
endset = lazy_string->end;
endset = lazy_string->end - lazy_string->start;
}
if (iport) {