File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -42,11 +42,12 @@ unixsock_path_value(VALUE path)
4242 }
4343 }
4444#endif
45+ path = rb_get_path (path );
4546#ifdef _WIN32
4647 /* UNIXSocket requires UTF-8 per spec. */
4748 path = rb_str_export_to_enc (path , rb_utf8_encoding ());
4849#endif
49- return rb_get_path ( path ) ;
50+ return path ;
5051}
5152
5253VALUE
Original file line number Diff line number Diff line change @@ -292,14 +292,18 @@ def bound_unix_socket(klass)
292292 File . unlink path if path && File . socket? ( path )
293293 end
294294
295- def test_open_nul_byte
296- tmpfile = Tempfile . new ( "s" )
297- path = tmpfile . path
298- tmpfile . close ( true )
299- assert_raise ( ArgumentError ) { UNIXServer . open ( path +"\0 " ) }
300- assert_raise ( ArgumentError ) { UNIXSocket . open ( path +"\0 " ) }
301- ensure
302- File . unlink path if path && File . socket? ( path )
295+ def test_open_argument
296+ assert_raise ( TypeError ) { UNIXServer . new ( nil ) }
297+ assert_raise ( TypeError ) { UNIXServer . new ( 1 ) }
298+ Tempfile . create ( "s" ) do |s |
299+ path = s . path
300+ s . close
301+ File . unlink ( path )
302+ assert_raise ( ArgumentError ) { UNIXServer . open ( path +"\0 " ) }
303+ assert_raise ( ArgumentError ) { UNIXSocket . open ( path +"\0 " ) }
304+ arg = Struct . new ( :to_path ) . new ( path )
305+ assert_equal ( path , UNIXServer . open ( arg ) { |server | server . path } )
306+ end
303307 end
304308
305309 def test_addr
Original file line number Diff line number Diff line change 1111# define RUBY_VERSION_MINOR RUBY_API_VERSION_MINOR
1212#define RUBY_VERSION_TEENY 7
1313#define RUBY_RELEASE_DATE RUBY_RELEASE_YEAR_STR"-"RUBY_RELEASE_MONTH_STR"-"RUBY_RELEASE_DAY_STR
14- #define RUBY_PATCHLEVEL 67
14+ #define RUBY_PATCHLEVEL 68
1515
1616#include "ruby/version.h"
1717#include "ruby/internal/abi.h"
You can’t perform that action at this time.
0 commit comments