fixed a somewhat awkward error message that made 'system' look awkward

(manually adapted)

(cherry picked from commit f2b9cdaadd)
This commit is contained in:
Matthias Felleisen 2012-07-20 10:37:37 -04:00 committed by Ryan Culpepper
parent fd7c2ad407
commit 913f6365f9

View File

@ -59,7 +59,7 @@
(raise-mismatch-error (raise-mismatch-error
who who
"expected a single string argument after: " "expected a single string argument after: "
(car args))) (car args)))
(unless (and (>= 2 (length args)) (unless (and (>= 2 (length args))
(string? (cadr args)) (string? (cadr args))
(path-or-ok-string? (cadr args))) (path-or-ok-string? (cadr args)))
@ -78,17 +78,20 @@
(raise-argument-error (raise-argument-error
who who
(string-append "(or/c path-string?\n" (string-append "(or/c path-string?\n"
" (and/c bytes? (lambda (bs) (not (memv 0 (bytes->list bs))))))") " (and/c bytes? bytes-no-nuls?))")
s)))]) s)))])
args) args)
;; MF: fxing a somewhat awkward looking error message. Comment for Matthew in case he wants to improve on it.
(provide string-no-nuls? bytes-no-nuls?)
(define (check-command who str) (define (check-command who str)
(unless (or (string-no-nuls? str) (unless (or (string-no-nuls? str)
(bytes-no-nuls? str)) (bytes-no-nuls? str))
(raise-argument-error (raise-argument-error
who who
(string-append "(or/c (and/c string? (lambda (s) (not (memv #\\nul (string->list s)))))\n" (string-append "(or/c (and/c string? string-no-nuls?)\n"
" (and/c bytes? (lambda (bs) (not (memv 0 (bytes->list bs))))))") " (and/c bytes? bytes-no-nuls?))")
str))) str)))
;; Old-style functions: ---------------------------------------- ;; Old-style functions: ----------------------------------------