[MacRuby] #336: Defining a method with a colon somewhere in the name and whitespace at the end will loose the trailing whitespace. (was: NoMethodError with shoulda tests)
MacRuby
ruby-noreply at macosforge.org
Mon Mar 21 16:48:11 PDT 2011
#336: Defining a method with a colon somewhere in the name and whitespace at the
end will loose the trailing whitespace. (was: NoMethodError with shoulda
tests)
----------------------------------------+-----------------------------------
Reporter: macruby@… | Owner: lsansonetti@…
Type: defect | Status: new
Priority: major | Milestone: MacRuby 1.0
Component: MacRuby | Keywords: #reduction
----------------------------------------+-----------------------------------
Comment(by cyberfox@…):
Greetings,
I'm going to guess:
{{{
diff --git a/vm.cpp b/vm.cpp
index aa2fac1..0f4b682 100644
--- a/vm.cpp
+++ b/vm.cpp
@@ -2604,7 +2604,9 @@ define_method:
else if (genuine_selector && arity.min == 0) {
char buf[100];
strlcpy(buf, sel_name, sizeof buf);
- buf[strlen(buf) - 1] = 0; // remove the ending ':'
+ if(buf[strlen(buf)-1] == ':' {
+ buf[strlen(buf) - 1] = 0; // remove the ending ':'
+ }
sel = sel_registerName(buf);
types_count = 3;
redefined = true;
}}}
-- Morgan
p.s. I'm trying to build it to test, but it's...more complex than I
expected to build. I'm betting it's the answer, though. Or something
like it.
--
Ticket URL: <http://www.macruby.org/trac/ticket/336#comment:11>
MacRuby <http://macruby.org/>
More information about the macruby-tickets
mailing list