From 9744ffed96caf35d5f1b10f96d58a36e249fae9d Mon Sep 17 00:00:00 2001 From: nobu Date: Wed, 25 Jan 2017 06:05:51 +0000 Subject: .gdbinit: fix on empty strings [ci skip] * .gdbinit (output_string): get rid of "Invalid number 0 of repetitions" error on empty strings. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57419 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- .gdbinit | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to '.gdbinit') diff --git a/.gdbinit b/.gdbinit index 06a616cf54..09013ab53c 100644 --- a/.gdbinit +++ b/.gdbinit @@ -446,9 +446,13 @@ define output_string 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 -- cgit v1.2.3