mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-04-30 11:50:28 +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
|
(parse
|
||||||
args
|
args
|
||||||
(cons
|
(cons
|
||||||
(let ((where (substring arg 8)))
|
(let ((where (substring arg 9)))
|
||||||
(cond
|
(cond
|
||||||
((string->number where) ; --listen=PORT
|
((string->number where) ; --listen=PORT
|
||||||
=> (lambda (port)
|
=> (lambda (port)
|
||||||
(if (and (integer? port) (exact? port) (>= port 0))
|
(if (and (integer? port) (exact? port) (>= port 0))
|
||||||
(error "invalid port for --listen")
|
|
||||||
`(@@ (system repl server)
|
`(@@ (system repl server)
|
||||||
(spawn-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
|
((string-prefix? "/" where) ; --listen=/PATH/TO/SOCKET
|
||||||
`(@@ (system repl server)
|
`(@@ (system repl server)
|
||||||
(spawn-server
|
(spawn-server
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue