Use Shellwords.split before calling system [Fixes #810]
This commit is contained in:
parent
ca41041e4c
commit
8f827ea403
|
@ -53,7 +53,7 @@ class Pry
|
||||||
# Note we dont want to use Pry.config.system here as that
|
# 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
|
# may be invoked non-interactively (i.e via Open4), whereas we want to
|
||||||
# ensure the editor is always interactive
|
# 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
|
end
|
||||||
|
|
||||||
# We need JRuby specific code here cos just shelling out using
|
# We need JRuby specific code here cos just shelling out using
|
||||||
|
@ -61,7 +61,7 @@ class Pry
|
||||||
def open_editor_on_jruby(editor_invocation)
|
def open_editor_on_jruby(editor_invocation)
|
||||||
begin
|
begin
|
||||||
require 'spoon'
|
require 'spoon'
|
||||||
pid = Spoon.spawnp(*editor_invocation.split)
|
pid = Spoon.spawnp(*Shellwords.split(editor_invocation))
|
||||||
Process.waitpid(pid)
|
Process.waitpid(pid)
|
||||||
rescue FFI::NotFoundError
|
rescue FFI::NotFoundError
|
||||||
system(editor_invocation)
|
system(editor_invocation)
|
||||||
|
|
Loading…
Reference in New Issue