commit ff262e102983021abc2223e83131eea1f7eb5d58 from: Russ Cox date: Fri Jan 28 22:17:01 2011 UTC Plumb.app: handle spaces in file names (Rob Pike) R=rsc http://codereview.appspot.com/4113042 commit - cbcec5adb9cb2274f3c4e2f3a8f4926b2e9689e8 commit + ff262e102983021abc2223e83131eea1f7eb5d58 blob - 87e355aa9d187ecf9bf6f695db7f2eb7cd9ed248 blob + 80918aa255ca98fc76ad498c05a376125079290f --- mac/Plumb.app/Contents/MacOS/plumb +++ 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