From 8f827ea40304caa0e2ca24bd414005e7c7f22263 Mon Sep 17 00:00:00 2001 From: Conrad Irwin Date: Sun, 24 Mar 2013 23:36:08 -0700 Subject: [PATCH] Use Shellwords.split before calling system [Fixes #810] --- lib/pry/editor.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/pry/editor.rb b/lib/pry/editor.rb index 8363071e..b4b2547f 100644 --- a/lib/pry/editor.rb +++ b/lib/pry/editor.rb @@ -53,7 +53,7 @@ class Pry # Note we dont want to use Pry.config.system here as that # may be invoked non-interactively (i.e via Open4), whereas we want to # ensure the editor is always interactive - system(editor_invocation) or raise CommandError, "`#{editor_invocation}` gave exit status: #{$?.exitstatus}" + system(*Shellwords.split(editor_invocation)) or raise CommandError, "`#{editor_invocation}` gave exit status: #{$?.exitstatus}" end # We need JRuby specific code here cos just shelling out using @@ -61,7 +61,7 @@ class Pry def open_editor_on_jruby(editor_invocation) begin require 'spoon' - pid = Spoon.spawnp(*editor_invocation.split) + pid = Spoon.spawnp(*Shellwords.split(editor_invocation)) Process.waitpid(pid) rescue FFI::NotFoundError system(editor_invocation)