[前][次][番号順一覧][スレッド一覧]

ruby-changes:40336

From: nobu <ko1@a...>
Date: Sun, 1 Nov 2015 08:39:44 +0900 (JST)
Subject: [ruby-changes:40336] nobu:r52417 (trunk): tcltklib.c: basename

nobu	2015-11-01 08:39:37 +0900 (Sun, 01 Nov 2015)

  New Revision: 52417

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=52417

  Log:
    tcltklib.c: basename
    
    * ext/tk/tcltklib.c (setup_rubytkkit): use ruby_enc_find_basename
      if available, instead of File.basename.

  Modified files:
    trunk/ext/tk/extconf.rb
    trunk/ext/tk/tcltklib.c
Index: ext/tk/tcltklib.c
===================================================================
--- ext/tk/tcltklib.c	(revision 52416)
+++ ext/tk/tcltklib.c	(revision 52417)
@@ -1263,11 +1263,17 @@ setup_rubytkkit(void) https://github.com/ruby/ruby/blob/trunk/ext/tk/tcltklib.c#L1263
 #ifdef __WIN32__
     /* rbtk_win32_SetHINSTANCE("tcltklib.so"); */
     {
+# ifdef HAVE_RUBY_ENC_FIND_BASENAME
+      const char *base = ruby_enc_find_basename(rb_sourcefile(), NULL, NULL,
+						rb_filesystem_encoding());
+      rbtk_win32_SetHINSTANCE(base);
+# else
       VALUE basename;
       basename = rb_funcall(rb_cFile, rb_intern("basename"), 1,
 			    rb_str_new2(rb_sourcefile()));
       rbtk_win32_SetHINSTANCE(RSTRING_PTR(basename));
       RB_GC_GUARD(basename);
+# endif
     }
 #endif
     set_rubytk_kitpath(rb_sourcefile());
Index: ext/tk/extconf.rb
===================================================================
--- ext/tk/extconf.rb	(revision 52416)
+++ ext/tk/extconf.rb	(revision 52417)
@@ -1795,7 +1795,9 @@ print("check functions.") https://github.com/ruby/ruby/blob/trunk/ext/tk/extconf.rb#L1795
 
 %w"ruby_native_thread_p rb_errinfo rb_safe_level rb_hash_lookup
  rb_proc_new rb_obj_untrust rb_obj_taint rb_set_safe_level_force
- rb_sourcefile rb_thread_alive_p rb_thread_check_trap_pending".each do |func|
+ rb_sourcefile rb_thread_alive_p rb_thread_check_trap_pending
+ ruby_enc_find_basename
+".each do |func|
   have_func(func, "ruby.h")
   print(".") # progress
 end

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]