Preserve encoding in error message for invalid env exec option
This commit is contained in:
parent
33aaa2aa15
commit
f57e2d7296
@ -2325,7 +2325,7 @@ check_exec_env_i(st_data_t st_key, st_data_t st_val, st_data_t arg)
|
||||
|
||||
k = StringValueCStr(key);
|
||||
if (strchr(k, '='))
|
||||
rb_raise(rb_eArgError, "environment name contains a equal : %s", k);
|
||||
rb_raise(rb_eArgError, "environment name contains a equal : %"PRIsVALUE, key);
|
||||
|
||||
if (!NIL_P(val))
|
||||
StringValueCStr(val);
|
||||
|
@ -342,6 +342,9 @@ class TestProcess < Test::Unit::TestCase
|
||||
assert_raise_with_message(ArgumentError, /fo=fo/) {
|
||||
system({"fo=fo"=>"ha"}, *ENVCOMMAND)
|
||||
}
|
||||
assert_raise_with_message(ArgumentError, /\u{30c0}=\u{30e1}/) {
|
||||
system({"\u{30c0}=\u{30e1}"=>"ha"}, *ENVCOMMAND)
|
||||
}
|
||||
end
|
||||
|
||||
def test_execopt_env_path
|
||||
|
Loading…
x
Reference in New Issue
Block a user