Commit 58c13794 authored by Francois-Rene Rideau's avatar Francois-Rene Rideau
Browse files

Fix an off-by-one bug in parsing source-registry configurations as strings.

parent 38490d2c
Loading
Loading
Loading
Loading
+5 −3
Original line number Diff line number Diff line
@@ -262,7 +262,7 @@
  ;; This parameter isn't actually user-visible
  ;; -- please use the exported function ASDF:ASDF-VERSION below.
  ;; the 1+ hair is to ensure that we don't do an inadvertent find and replace
  (subseq "VERSION:1.654" (1+ (length "VERSION"))))
  (subseq "VERSION:1.655" (1+ (length "VERSION"))))

(defun asdf-version ()
  "Exported interface to the version of ASDF currently installed. A string.
@@ -2393,7 +2393,9 @@ with a different configuration, so the configuration would be re-read then."
     '(:output-translations :inherit-configuration))
    ((not (stringp string))
     (error "environment string isn't: ~S" string))
    ((find (char string 0) "\"(")
    ((eql (char string 0) #\")
     (parse-output-translations-string (read-from-string string)))
    ((eql (char string 0) #\()
     (validate-output-translations-form (read-from-string string)))
    (t
     (loop
@@ -2416,7 +2418,7 @@ with a different configuration, so the configuration would be re-read then."
          (t
           (setf source s)))
        (setf start (1+ i))
        (when (>= start end)
        (when (> start end)
          (when source
            (error "Uneven number of components in source to destination mapping ~S" string))
          (unless inherit
+1 −1
Original line number Diff line number Diff line
@@ -2123,7 +2123,7 @@ which by default is the same as using

Configuration directories consist in files each contains
a list of directives without any enclosing
@code{(:asdf-output-translations ...)} form.
@code{(:output-translations ...)} form.
The files will be sorted by namestring as if by @code{#'string<} and
the lists of directives of these files with be concatenated in order.
An implicit @code{:inherit-configuration} will be included
+16 −0
Original line number Diff line number Diff line
@@ -41,4 +41,20 @@
 (asdf::version-satisfies (asdf:asdf-version) "1.608"))
(assert
 (not (asdf::version-satisfies (asdf:asdf-version) "666")))

(assert
 (equal (asdf::parse-output-translations-string "/foo:/bar::/baz:/quux")
        '(:output-translations
          ("/foo" "/bar")
          :inherit-configuration
          ("/baz" "/quux"))))
(assert
 (equal (asdf::parse-output-translations-string "/:")
        '(:output-translations ("/" nil) :ignore-inherited-configuration)))
(assert
 (equal (asdf::parse-output-translations-string "/::")
        '(:output-translations ("/" nil) :inherit-configuration)))
(assert
 (equal (asdf::parse-output-translations-string "/:/")
        '(:output-translations ("/" "/") :ignore-inherited-configuration)))
)