From: Mark Wooding Date: Tue, 15 Apr 2014 11:00:49 +0000 (+0100) Subject: zone.lisp: Fix default output directory. X-Git-Url: https://git.distorted.org.uk/~mdw/zone/commitdiff_plain/3d7852d98d9a540ce6b68a4ed26d170c78c7a2c7?hp=f1d7d492baa865026add48fa604328c87ac7042e zone.lisp: Fix default output directory. The code used to capture `*default-pathname-defaults*' in `*zone-output-path*' at load time, which (varying by implementation) might indicate the calling process's working directory, or might be the directory from which the file was loaded. The latter is obviously wrong, so we adopt the convention in `zone-file-name' that if `*zone-output-path*' is nil then we use `*default-pathname-defaults' from the time of the call. --- diff --git a/zone.lisp b/zone.lisp index 8d35c09..f497037 100644 --- a/zone.lisp +++ b/zone.lisp @@ -207,8 +207,12 @@ records) (export '*zone-output-path*) -(defvar *zone-output-path* *default-pathname-defaults* - "Pathname defaults to merge into output files.") +(defvar *zone-output-path* nil + "Pathname defaults to merge into output files. + + If this is nil then use the prevailing `*default-pathname-defaults*'. + This is not the same as capturing the `*default-pathname-defaults*' from + load time.") (export '*preferred-subnets*) (defvar *preferred-subnets* nil @@ -221,7 +225,7 @@ "Choose a file name for a given ZONE and TYPE." (merge-pathnames (make-pathname :name (string-downcase zone) :type (string-downcase type)) - *zone-output-path*)) + (or *zone-output-path* *default-pathname-defaults*))) (export 'zone-preferred-subnet-p) (defun zone-preferred-subnet-p (name)