From 8857e271d810623868509f837d17613195f6528c Mon Sep 17 00:00:00 2001 From: Ian Price Date: Wed, 30 Jul 2014 18:58:16 +0100 Subject: [PATCH] Prevent add-to-load-path from adding duplicate entries * module/ice-9/boot-9.scm (add-to-load-path): Remove argument from %load-path (if it exists) before pushing. This also means that the `elt' will always be at the front of %load-path. --- module/ice-9/boot-9.scm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/module/ice-9/boot-9.scm b/module/ice-9/boot-9.scm index b2cf48186..872594b20 100644 --- a/module/ice-9/boot-9.scm +++ b/module/ice-9/boot-9.scm @@ -1748,7 +1748,7 @@ VALUE." (define-syntax-rule (add-to-load-path elt) "Add ELT to Guile's load path, at compile-time and at run-time." (eval-when (expand load eval) - (set! %load-path (cons elt %load-path)))) + (set! %load-path (cons elt (delete elt %load-path))))) (define %load-verbosely #f) (define (assert-load-verbosity v) (set! %load-verbosely v))