mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-04-30 03:40:34 +02:00
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.
This commit is contained in:
parent
a8d7fba8d4
commit
86b4309b71
1 changed files with 3 additions and 3 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue