summaryrefslogtreecommitdiff
path: root/rc
diff options
context:
space:
mode:
authorOri Bernstein <ori@eigenstate.org>2021-06-12 18:03:26 +0000
committerOri Bernstein <ori@eigenstate.org>2021-06-12 18:03:26 +0000
commitc12e49ecbf4ae7933b13d592543c9f7c7dc03581 (patch)
tree18aef819f1aaf7508f201bd94573f8e9f2616d37 /rc
parent1c30bd451e1813f1cf9f9db4d7c1a4f3f95d1e37 (diff)
downloadplan9front-c12e49ecbf4ae7933b13d592543c9f7c7dc03581.tar.xz
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.
Diffstat (limited to 'rc')
-rwxr-xr-xrc/bin/B11
1 files changed, 5 insertions, 6 deletions
diff --git a/rc/bin/B b/rc/bin/B
index 866242438..c5666aa28 100755
--- a/rc/bin/B
+++ b/rc/bin/B
@@ -10,10 +10,9 @@ if(~ $#* 0){
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]