From de167e575bc003668bc296cfd996d0d1ee702605 Mon Sep 17 00:00:00 2001 From: Chris Hanson Date: Sat, 22 Apr 2017 23:54:55 -0700 Subject: [PATCH] Check that string-find-X-index args are in NFC? --- src/runtime/ustring.scm | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/runtime/ustring.scm b/src/runtime/ustring.scm index cb3bb3b21..3e949c589 100644 --- a/src/runtime/ustring.scm +++ b/src/runtime/ustring.scm @@ -1725,6 +1725,8 @@ USA. #t)))) (define (string-find-first-index proc string . strings) + (guarantee nfc-string? string 'string-find-first-index) + (guarantee-list-of nfc-string? strings 'string-find-first-index) (receive (n proc) (mapper-values proc string strings) (let loop ((i 0)) (and (fix:< i n) @@ -1733,6 +1735,8 @@ USA. (loop (fix:+ i 1))))))) (define (string-find-last-index proc string . strings) + (guarantee nfc-string? string 'string-find-last-index) + (guarantee-list-of nfc-string? strings 'string-find-last-index) (receive (n proc) (mapper-values proc string strings) (let loop ((i (fix:- n 1))) (and (fix:>= i 0) -- 2.25.1