clay: get-fit fix from ted

This commit is contained in:
Philip Monk 2020-04-15 19:55:41 -07:00
parent 311cf5329c
commit 6441116e9f
No known key found for this signature in database
GPG Key ID: B66E1F02604E44EC

View File

@ -2666,10 +2666,16 @@
++ get-fit
|= pax=path
^- (unit path)
:: add the hoon extension to the result
::
=- ?~(- ~ `(snoc u.- %hoon))
|- ^- (unit path)
?> ?=([* * ~] pax)
:: put the prefix back on the result
::
=- ?~(- ~ `[i.pax u.-])
=. nak (~(got by dir.nak) i.pax)
?^ got=(get t.pax)
?^ got=(get (snoc t.pax %hoon))
(some t.pax)
=/ seg=tape (trip i.t.pax)
?~ dex=(find "-" seg)