git: 9front

Download patch

ref: 9100648fb1a1de7a720cb3479fb6afe506e428f1
parent: 23183328ba5da5875eb29560a1c5b6a0ee9c4f3b
author: Ori Bernstein <ori@eigenstate.org>
date: Sat Jun 12 14:03:26 EDT 2021

B: expand path when plumbing files

When we plumb a file, we open it in the current working
directory if it exists. However, if it doesn't exist,
we end up opening it relative to the editor's working
directory.

Expanding the path to works around this issue.

--- a/rc/bin/B
+++ b/rc/bin/B
@@ -10,10 +10,9 @@
 	exit usage
 }
 
-if(test -f /mnt/plumb/edit || test -f /mnt/term/mnt/plumb/edit){
-	for(i)
-		plumb -s B -d edit $i
-	exit
+wdir=`{pwd}
+for(i){
+	if(! ~ $i /*)
+		i=$wdir/$i
+	plumb -s B -d edit $i
 }
-
-echo 'no plumber' >[1=2]
--