about summary refs log tree commit diff
path: root/tools
diff options
context:
space:
mode:
authorsterni <sternenseemann@systemli.org>2021-12-18T19·27+0100
committersterni <sternenseemann@systemli.org>2021-12-18T20·23+0000
commit3090f61713c7360b12d5ae710686376b0c5e6f82 (patch)
treeff24939bad29a354f6ed110d553cb16009bed4b2 /tools
parent4c07a97af31ad9707ab82115228fd888dde6284e (diff)
fix(tools/magrathea): prevent trailing slash for // in path r/3294
All targets would have no trailing slash, so it was at least ugly that
// had one as the only legal target.

Change-Id: I1b60850ac86d8c550f262841694fb00c518413b8
Reviewed-on: https://cl.tvl.fyi/c/depot/+/4404
Autosubmit: sterni <sternenseemann@systemli.org>
Tested-by: BuildkiteCI
Reviewed-by: tazjin <mail@tazj.in>
Diffstat (limited to 'tools')
-rw-r--r--tools/magrathea/mg.scm13
1 files changed, 7 insertions, 6 deletions
diff --git a/tools/magrathea/mg.scm b/tools/magrathea/mg.scm
index 990fb87f90ba..e5b0cb07d4de 100644
--- a/tools/magrathea/mg.scm
+++ b/tools/magrathea/mg.scm
@@ -246,12 +246,13 @@ USAGE
 (define (path args)
   (match args
          [(arg)
-          (print (conc (repository-root)
-                       "/"
-                       (string-intersperse
-                        (target-components
-                         (normalise-target
-                          (guarantee-success (parse-target arg)))) "/")))]
+          (print (apply string-append
+                        (intersperse
+                         (cons (repository-root)
+                               (target-components
+                                (normalise-target
+                                 (guarantee-success (parse-target arg)))))
+                         "/")))]
          [() (mg-error "path command needs a target")]
          [other (mg-error (format "unknown arguments: ~a" other))]))