Verify the argument is a string?
For the fast path of splitting on whitespace, verify the str argument is a string, so that internal-split will handle the invalid argument error.
This commit is contained in:
parent
d061df81ce
commit
754b3457c3
|
@ -148,7 +148,7 @@
|
|||
[else (loop beg (add1 end))])))
|
||||
|
||||
(define (string-split str [sep none] #:trim? [trim? #t] #:repeat? [+? #f])
|
||||
(if (and (eq? sep none) trim?)
|
||||
(if (and (string? str) (eq? sep none) trim?)
|
||||
(internal-split-whitespace str)
|
||||
(internal-split 'string-split str sep trim? +?)))
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user