diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-01-16 02:43:55 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-01-16 02:43:55 +0000 |
commit | 803621f6d7e8415452fec49292b2b045dc04fa37 (patch) | |
tree | c6079e9786e253faedf45839d3f2072c62b2c731 /file.c | |
parent | 992b0148cacc7abbd439691460b5d937930e53ca (diff) | |
download | ruby-803621f6d7e8415452fec49292b2b045dc04fa37.tar.gz |
file.c: refine message
* file.c (rb_get_path_check_convert): refine the error message
when the path name contains null byte.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57336 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'file.c')
-rw-r--r-- | file.c | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -195,7 +195,9 @@ rb_get_path_check_convert(VALUE obj, VALUE tmp, int level) } check_path_encoding(tmp); - StringValueCStr(tmp); + if (!rb_str_to_cstr(tmp)) { + rb_raise(rb_eArgError, "path name contains null byte"); + } return rb_str_new4(tmp); } |