From 669c79ceebe3f8dfa553767f321bcfb10c114d8f Mon Sep 17 00:00:00 2001 From: Elliot Glaysher Date: Tue, 4 Sep 2018 15:57:29 -0700 Subject: [PATCH] Make dojo not produce incorrect beams when they start with '/'. --- app/dojo.hoon | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/app/dojo.hoon b/app/dojo.hoon index e45d46794..38fabbe18 100644 --- a/app/dojo.hoon +++ b/app/dojo.hoon @@ -297,7 +297,20 @@ ;~(pose sym (easy dp-default-app)) == ++ dp-beam :: ++beam - %+ cook |=(a/path =+((de-beam a) ?^(- u [he-beak (flop a)]))) + %+ cook + |= a/path + :: hack: fixup paths that come out of the hoon parser + :: + :: We currently invoke the hoon parser to read relative paths from + :: the command line, and this parser will produce leading ~ path + :: components with paths that start with a `/`. + :: + :: This entire path is nuts and we shouldn't be representing paths + :: as arbitrary hoons. + :: + =? a &(?=(^ a) =('' i.a)) + t.a + =+((de-beam a) ?^(- u [he-beak (flop a)])) =+ vez=(vang | dp-path) (sear plex:vez (stag %clsg poor:vez)) ::