On 7/26/09 3:03 AM, in article A2161761-80B3-4D46-8D67-D3968371A7FB@textmate.org, "Allan Odgaard" mailinglist@textmate.org wrote:
Yeah, it is a very common problem. What you need to do is add this line:
require ENV['TM_SUPPORT_PATH'] + '/lib/escape'
Then whenever you send a string to the shell, use the e_sh function to properly escape it. E.g.:
path = "some path with spaces" dst = ENV['TMPDIR'] || "/tmp" IO.popen("cp #{e_sh path} #{e_sh dst}", )
Thanks - I did that as my first solution, but then I realized that since the whole thing was going to the shell I could escape it by quoting it, just as I would do in the shell:
IO.popen(%{"#{ENV['TM_SUPPORT_PATH']}/bin/Markdown.pl"}, ...)
or whatever. That seems to be working... m.