aboutsummaryrefslogtreecommitdiff
path: root/mac
diff options
context:
space:
mode:
authorRuss Cox <rsc@swtch.com>2011-01-28 17:17:01 -0500
committerRuss Cox <rsc@swtch.com>2011-01-28 17:17:01 -0500
commitff262e102983021abc2223e83131eea1f7eb5d58 (patch)
tree526281a3c113984d543a77fcb4ae334e4b1d544c /mac
parentcbcec5adb9cb2274f3c4e2f3a8f4926b2e9689e8 (diff)
downloadplan9port-ff262e102983021abc2223e83131eea1f7eb5d58.tar.gz
plan9port-ff262e102983021abc2223e83131eea1f7eb5d58.tar.bz2
plan9port-ff262e102983021abc2223e83131eea1f7eb5d58.zip
Plumb.app: handle spaces in file names (Rob Pike)
R=rsc http://codereview.appspot.com/4113042
Diffstat (limited to 'mac')
-rwxr-xr-xmac/Plumb.app/Contents/MacOS/plumb10
1 files changed, 9 insertions, 1 deletions
diff --git a/mac/Plumb.app/Contents/MacOS/plumb b/mac/Plumb.app/Contents/MacOS/plumb
index 87e355aa..80918aa2 100755
--- a/mac/Plumb.app/Contents/MacOS/plumb
+++ b/mac/Plumb.app/Contents/MacOS/plumb
@@ -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 content.
+if echo "$filename" | grep -q " "
+then
+ base=$(basename "$filename" | sed 's/ /_/g')
+ cat "$filename" | plumb -i -d edit -a "action=showdata filename=/BadName/$base"
+else
+ $PLAN9/bin/plumb -d edit "$filename"
+fi