mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-05-02 13:00:26 +02:00
fix double-loading of script in -ds case
* module/ice-9/command-line.scm (compile-shell-switches): In the -ds case, we were erroneously loading the script twice. Fix that.
This commit is contained in:
parent
800690141f
commit
dac9812a2e
1 changed files with 14 additions and 12 deletions
|
@ -197,25 +197,27 @@ If FILE begins with `-' the -s switch is mandatory.
|
||||||
(args (cdr args)))
|
(args (cdr args)))
|
||||||
(cond
|
(cond
|
||||||
((not (string-prefix? "-" arg)) ; foo
|
((not (string-prefix? "-" arg)) ; foo
|
||||||
;; If we specified the -ds option, do_script points to the
|
;; If we specified the -ds option, do-script is the cdr of
|
||||||
;; cdr of an expression like (load #f) we replace the car
|
;; an expression like (load #f). We replace the car (i.e.,
|
||||||
;; (i.e., the #f) with the script name.
|
;; the #f) with the script name.
|
||||||
(if (pair? do-script)
|
|
||||||
(set-car! do-script arg))
|
|
||||||
(set! arg0 arg)
|
(set! arg0 arg)
|
||||||
(set! interactive? #f)
|
(set! interactive? #f)
|
||||||
(finish args
|
(if (pair? do-script)
|
||||||
(cons `(load ,arg) out)))
|
(begin
|
||||||
|
(set-car! do-script arg0)
|
||||||
|
(finish args out))
|
||||||
|
(finish args (cons `(load ,arg0) out))))
|
||||||
|
|
||||||
((string=? arg "-s") ; foo
|
((string=? arg "-s") ; foo
|
||||||
(if (null? args)
|
(if (null? args)
|
||||||
(error "missing argument to `-s' switch"))
|
(error "missing argument to `-s' switch"))
|
||||||
(set! arg0 (car args))
|
(set! arg0 (car args))
|
||||||
(if (pair? do-script)
|
|
||||||
(set-car! do-script arg0))
|
|
||||||
(set! interactive? #f)
|
(set! interactive? #f)
|
||||||
(finish (cdr args)
|
(if (pair? do-script)
|
||||||
(cons `(load ,arg0) out)))
|
(begin
|
||||||
|
(set-car! do-script arg0)
|
||||||
|
(finish (cdr args) out))
|
||||||
|
(finish (cdr args) (cons `(load ,arg0) out))))
|
||||||
|
|
||||||
((string=? arg "-c") ; evaluate expr
|
((string=? arg "-c") ; evaluate expr
|
||||||
(if (null? args)
|
(if (null? args)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue