From 5100aad08194c2e7b2b9c94c04203d1934ce9611 Mon Sep 17 00:00:00 2001 From: Eli Barzilay Date: Sun, 20 Feb 2011 12:42:52 -0500 Subject: [PATCH] Fix error message, use a faster regexp test to search for NULs, forbid empty byte strings. original commit: fca0ed2111300dcbdb3825bdd319ae284d4ac22f --- collects/mzlib/process.rkt | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/collects/mzlib/process.rkt b/collects/mzlib/process.rkt index abbc789..6cc68b7 100644 --- a/collects/mzlib/process.rkt +++ b/collects/mzlib/process.rkt @@ -101,9 +101,10 @@ [else (for ([s (in-list args)]) (unless (or (path-string? s) - (and (bytes? s) - (for/and ([b (in-bytes s)]) (positive? b)))) - (raise-type-error who "path, string, or byte string (no with nuls)" s)))]) + (and (bytes? s) ((bytes-length s) . > . 0) + (not (regexp-match? #rx"\0" s)))) + (raise-type-error who "path, string, or byte string (without NULs)" + s)))]) args) (define (check-command who str)