summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIan Price <ianprice90@googlemail.com>2011-09-10 03:02:32 +0100
committerAndy Wingo <wingo@pobox.com>2011-09-10 11:06:32 -0700
commit86b4309b7166fe5ec4f55f0cc64501d07b0852f9 (patch)
tree67b0ac1fd6a9e17dd66e09eeb2907698711ac578
parenta8d7fba8d45220e4d12c57f5aa85bfade9d21100 (diff)
downloadguile-86b4309b7166fe5ec4f55f0cc64501d07b0852f9.tar.gz
Fix --listen option to allow other ports
* module/ice-9/command-line.scm (compile-shell-switches): Fix off-by-one error in 'substring', and swap branches of conditional.
-rw-r--r--module/ice-9/command-line.scm6
1 files changed, 3 insertions, 3 deletions
diff --git a/module/ice-9/command-line.scm b/module/ice-9/command-line.scm
index 706948f58..8aed74ec6 100644
--- a/module/ice-9/command-line.scm
+++ b/module/ice-9/command-line.scm
@@ -331,15 +331,15 @@ If FILE begins with `-' the -s switch is mandatory.
(parse
args
(cons
- (let ((where (substring arg 8)))
+ (let ((where (substring arg 9)))
(cond
((string->number where) ; --listen=PORT
=> (lambda (port)
(if (and (integer? port) (exact? port) (>= port 0))
- (error "invalid port for --listen")
`(@@ (system repl server)
(spawn-server
- (make-tcp-server-socket #:port ,port))))))
+ (make-tcp-server-socket #:port ,port)))
+ (error "invalid port for --listen"))))
((string-prefix? "/" where) ; --listen=/PATH/TO/SOCKET
`(@@ (system repl server)
(spawn-server