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

ruby-changes:45346

From: nobu <ko1@a...>
Date: Wed, 25 Jan 2017 15:05:56 +0900 (JST)
Subject: [ruby-changes:45346] nobu:r57419 (trunk): .gdbinit: fix on empty strings [ci skip]

nobu	2017-01-25 15:05:51 +0900 (Wed, 25 Jan 2017)

  New Revision: 57419

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

  Log:
    .gdbinit: fix on empty strings [ci skip]
    
    * .gdbinit (output_string): get rid of "Invalid number 0 of
      repetitions" error on empty strings.

  Modified files:
    trunk/.gdbinit
Index: .gdbinit
===================================================================
--- .gdbinit	(revision 57418)
+++ .gdbinit	(revision 57419)
@@ -446,9 +446,13 @@ define output_string https://github.com/ruby/ruby/blob/trunk/.gdbinit#L446
   set $len = ($flags & RUBY_FL_USER1) ? \
           ((struct RString*)($arg0))->as.heap.len : \
           (($flags & (RUBY_FL_USER2|RUBY_FL_USER3|RUBY_FL_USER4|RUBY_FL_USER5|RUBY_FL_USER6)) >> RUBY_FL_USHIFT+2)
-  output *(char *)(($flags & RUBY_FL_USER1) ? \
+  if $len > 0
+    output *(char *)(($flags & RUBY_FL_USER1) ? \
 	    ((struct RString*)($arg0))->as.heap.ptr : \
 	    ((struct RString*)($arg0))->as.ary) @ $len
+  else
+    output ""
+  end
 end
 
 define rp_string

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

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