>From 03b6fdfc3e4031ba94c94b4aa5f0844379297ae3 Mon Sep 17 00:00:00 2001 From: Evan Hanson Date: Sat, 28 Apr 2018 11:25:42 +0200 Subject: [PATCH] Make sure source filename argument precedes CHICKEN_OPTIONS The source filename argument is determined positionally (it must be the first argument), so it must be left in place when the contents of the CHICKEN_OPTIONS variable are added to the argument list. --- chicken.scm | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/chicken.scm b/chicken.scm index f6dae710..f56a6ac3 100644 --- a/chicken.scm +++ b/chicken.scm @@ -50,9 +50,11 @@ ;;; Prefix argument list with default options: (define compiler-arguments - (append - (string-split (or (get-environment-variable "CHICKEN_OPTIONS") "")) - (cdr (argv)))) + (let ((args (cdr (argv)))) + (append + (take args 1) ; Leave source filename argument first. + (string-split (or (get-environment-variable "CHICKEN_OPTIONS") "")) + (drop args 1)))) ;;; Process command-line options: -- 2.11.0