Changeset 13074 in project for chicken/trunk/regex.scm


Ignore:
Timestamp:
01/24/09 16:11:27 (11 years ago)
Author:
felix winkelmann
Message:

applied regex patches fixing indices from chicken-3 branch by Ivan to trunk (not tested yet)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • chicken/trunk/regex.scm

    r12937 r13074  
    105105(define (string-search rx str #!optional (start 0) (range (string-length str)))
    106106  (let ((rx (unregexp rx)))
    107     (and-let* ((m (irregex-search rx str start (fx+ start range))))
     107    (and-let* ((n (string-length str))
     108               (m (irregex-search rx str start (min n (fx+ start range)))))
    108109      (let loop ((i (irregex-match-num-submatches m))
    109110                 (res '()))
     
    114115(define (string-search-positions rx str #!optional (start 0) (range (string-length str)))
    115116  (let ((rx (unregexp rx)))
    116     (and-let* ((m (irregex-search rx str start (fx+ start range))))
     117    (and-let* ((n (string-length str))
     118               (m (irregex-search rx str start (min n (fx+ start (fx- n 1))))))
    117119      (let loop ((i (irregex-match-num-submatches m))
    118120                 (res '()))
Note: See TracChangeset for help on using the changeset viewer.