From 43a16c98df392e726040f0331a3e09d00c53d513 Mon Sep 17 00:00:00 2001 From: Jeremy Evans Date: Thu, 20 Jun 2019 13:19:48 -0700 Subject: Do not escape + in Shellwords.escape + is not a character that requires escaping in Bourne sh. Fixes [Bug #14429] --- test/test_shellwords.rb | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'test') diff --git a/test/test_shellwords.rb b/test/test_shellwords.rb index 16949c02d3..86971b7237 100644 --- a/test/test_shellwords.rb +++ b/test/test_shellwords.rb @@ -68,6 +68,11 @@ class TestShellwords < Test::Unit::TestCase assert_equal "ps -p #{$$}", joined end + def test_shellescape + assert_equal "''", shellescape('') + assert_equal "\\^AZaz09_\\\\-.,:/@'\n'+\\'\\\"", shellescape("^AZaz09_\\-.,:\/@\n+'\"") + end + def test_whitespace empty = '' space = " " -- cgit v1.2.3