tPlumb.app: handle spaces in file names (Rob Pike) - plan9port - [fork] Plan 9 … | |
git clone git://src.adamsgaard.dk/plan9port | |
Log | |
Files | |
Refs | |
README | |
LICENSE | |
--- | |
commit ff262e102983021abc2223e83131eea1f7eb5d58 | |
parent cbcec5adb9cb2274f3c4e2f3a8f4926b2e9689e8 | |
Author: Russ Cox <[email protected]> | |
Date: Fri, 28 Jan 2011 17:17:01 -0500 | |
Plumb.app: handle spaces in file names (Rob Pike) | |
R=rsc | |
http://codereview.appspot.com/4113042 | |
Diffstat: | |
M mac/Plumb.app/Contents/MacOS/plumb | 10 +++++++++- | |
1 file changed, 9 insertions(+), 1 deletion(-) | |
--- | |
diff --git a/mac/Plumb.app/Contents/MacOS/plumb b/mac/Plumb.app/Contents/MacOS/… | |
t@@ -1,4 +1,12 @@ | |
#!/bin/bash | |
. ~/.bashrc | |
PLAN9=${PLAN9:-/usr/local/plan9} | |
-$PLAN9/bin/plumb $($PLAN9/bin/macargv) | |
+filename="$($PLAN9/bin/macargv)" | |
+# Blank are problematic in the file name. Make them go away but keep the cont… | |
+if echo "$filename" | grep -q " " | |
+then | |
+ base=$(basename "$filename" | sed 's/ /_/g') | |
+ cat "$filename" | plumb -i -d edit -a "action=showdata filename=/BadNa… | |
+else | |
+ $PLAN9/bin/plumb -d edit "$filename" | |
+fi |