cs: fix handling of an empty command-line argument

This commit is contained in:
Matthew Flatt 2019-12-05 05:43:31 -07:00
parent 1f92e98590
commit c93693169a

View File

@ -558,8 +558,8 @@
(loop (cons (cadr args) (cons (car args) (cddr args))))])] (loop (cons (cadr args) (cons (car args) (cddr args))))])]
[else [else
(cond (cond
[(and (eqv? (string-ref arg 0) #\-) [(and (> (string-length arg) 1)
(> (string-length arg) 1)) (eqv? (string-ref arg 0) #\-))
(cond (cond
[(and (> (string-length arg) 2) [(and (> (string-length arg) 2)
(not (eqv? (string-ref arg 1) #\-))) (not (eqv? (string-ref arg 1) #\-)))