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

ruby-changes:7595

From: nobu <ko1@a...>
Date: Thu, 4 Sep 2008 10:44:57 +0900 (JST)
Subject: [ruby-changes:7595] Ruby:r19116 (trunk): * tool/transcode-tblgen.rb (citrus_decode_mapsrc): support older 1.8.

nobu	2008-09-04 10:43:50 +0900 (Thu, 04 Sep 2008)

  New Revision: 19116

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

  Log:
    * tool/transcode-tblgen.rb (citrus_decode_mapsrc): support older 1.8.

  Modified files:
    trunk/ChangeLog
    trunk/tool/transcode-tblgen.rb

Index: ChangeLog
===================================================================
--- ChangeLog	(revision 19115)
+++ ChangeLog	(revision 19116)
@@ -1,3 +1,7 @@
+Thu Sep  4 10:43:47 2008  Nobuyoshi Nakada  <nobu@r...>
+
+	* tool/transcode-tblgen.rb (citrus_decode_mapsrc): support older 1.8.
+
 Thu Sep  4 10:33:43 2008  Nobuyoshi Nakada  <nobu@r...>
 
 	* io.c (argf_next_argv, argf_set_encoding): copy struct wise.
Index: tool/transcode-tblgen.rb
===================================================================
--- tool/transcode-tblgen.rb	(revision 19115)
+++ tool/transcode-tblgen.rb	(revision 19116)
@@ -486,13 +486,13 @@
   mapsrcs.split(',').each do |mapsrc|
     path = [$srcdir]
     mode = nil
-    if mapsrc.start_with?('UCS')
+    if mapsrc.rindex('UCS', 0)
       mode = :from_ucs
       from = mapsrc[4..-1]
-      path << SUBDIR.find{|x| from.start_with?(x) }
+      path << SUBDIR.find{|x| from.rindex(x, 0) }
     else
       mode = :to_ucs
-      path << SUBDIR.find{|x| mapsrc.start_with?(x) }
+      path << SUBDIR.find{|x| mapsrc.rindex(x, 0) }
     end
     path << mapsrc.gsub(':', '@')
     path = File.join(*path)

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

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