Merge pull request #805 from urbit/fix-dojo-path-parsing

Make dojo not produce incorrect beams when they start with '/'.
This commit is contained in:
Elliot Glaysher 2018-09-04 16:16:04 -07:00 committed by GitHub
commit b816bd81e3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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))
::