1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-05-01 04:10:18 +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:
Andy Wingo 2011-04-28 21:43:01 +02:00
parent 800690141f
commit dac9812a2e

View file

@ -197,26 +197,28 @@ If FILE begins with `-' the -s switch is mandatory.
(args (cdr args)))
(cond
((not (string-prefix? "-" arg)) ; foo
;; If we specified the -ds option, do_script points to the
;; cdr of an expression like (load #f) we replace the car
;; (i.e., the #f) with the script name.
(if (pair? do-script)
(set-car! do-script arg))
;; If we specified the -ds option, do-script is the cdr of
;; an expression like (load #f). We replace the car (i.e.,
;; the #f) with the script name.
(set! arg0 arg)
(set! interactive? #f)
(finish args
(cons `(load ,arg) out)))
(if (pair? do-script)
(begin
(set-car! do-script arg0)
(finish args out))
(finish args (cons `(load ,arg0) out))))
((string=? arg "-s") ; foo
(if (null? args)
(error "missing argument to `-s' switch"))
(set! arg0 (car args))
(if (pair? do-script)
(set-car! do-script arg0))
(set! interactive? #f)
(finish (cdr args)
(cons `(load ,arg0) out)))
(if (pair? do-script)
(begin
(set-car! do-script arg0)
(finish (cdr args) out))
(finish (cdr args) (cons `(load ,arg0) out))))
((string=? arg "-c") ; evaluate expr
(if (null? args)
(error "missing argument to `-c' switch"))