summaryrefslogtreecommitdiff
path: root/module
diff options
context:
space:
mode:
authorThomas Danckaert <thomas.danckaert@gmail.com>2017-04-19 18:14:38 +0200
committerAndy Wingo <wingo@pobox.com>2017-04-20 10:58:54 +0200
commit02cf38514d85182ee5b1f89968d5052b1e3b40ca (patch)
tree881a5084a70505ab79372ed7c215f8afe94cb066 /module
parent40df57a8a2b706bab0b2bda84dd2ce98f1be8e3b (diff)
downloadguile-02cf38514d85182ee5b1f89968d5052b1e3b40ca.tar.gz
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.
Diffstat (limited to 'module')
-rw-r--r--module/srfi/srfi-37.scm3
1 files changed, 2 insertions, 1 deletions
diff --git a/module/srfi/srfi-37.scm b/module/srfi/srfi-37.scm
index 3f654af2c..c34b0d083 100644
--- a/module/srfi/srfi-37.scm
+++ b/module/srfi/srfi-37.scm
@@ -217,7 +217,8 @@ program-arguments in ARGS, as decided by the OPTIONS'
(if (null? args)
(apply values seeds)
(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))) ;"-"
(mutate-seeds! operand-proc arg)
(set! args (cdr args)))