mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-05-20 19:50:24 +02:00
SRFI-37: Account for zero-length arguments.
* module/srfi/srfi-37.scm (args-fold): When checking if an argument is an option (starts with #\-), first check if the length is non-zero.
This commit is contained in:
parent
40df57a8a2
commit
02cf38514d
1 changed files with 2 additions and 1 deletions
|
@ -217,7 +217,8 @@ program-arguments in ARGS, as decided by the OPTIONS'
|
||||||
(if (null? args)
|
(if (null? args)
|
||||||
(apply values seeds)
|
(apply values seeds)
|
||||||
(let ((arg (car args)))
|
(let ((arg (car args)))
|
||||||
(cond ((or (not (char=? #\- (string-ref arg 0)))
|
(cond ((or (string-null? arg)
|
||||||
|
(not (char=? #\- (string-ref arg 0)))
|
||||||
(= 1 (string-length arg))) ;"-"
|
(= 1 (string-length arg))) ;"-"
|
||||||
(mutate-seeds! operand-proc arg)
|
(mutate-seeds! operand-proc arg)
|
||||||
(set! args (cdr args)))
|
(set! args (cdr args)))
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue