diff --git a/Source/Modules/r.cxx b/Source/Modules/r.cxx index bd1b9107e..edad26e53 100644 --- a/Source/Modules/r.cxx +++ b/Source/Modules/r.cxx @@ -974,7 +974,9 @@ int R::OutputClassMemberTable(Hash *tb, File *out) { String *key; int i, n = Len(keys); /* Loop over all the _set and _get entries in the table. */ - + /* This function checks for names ending in _set - perhaps it should */ + /* use attributes of some other form, as it potentially clashes with */ + /* methods ending in _set */ if(n && outputNamespaceInfo) { Printf(s_namespace, "exportClasses("); } @@ -984,9 +986,12 @@ int R::OutputClassMemberTable(Hash *tb, File *out) { String *className = Getitem(el, 0); char *ptr = Char(key); - ptr = &ptr[Len(key) - 3]; - int isSet = strcmp(ptr, "set") == 0; - + int klen = Len(key); + int isSet = 0; + if (klen > 4) { + ptr = &ptr[Len(key) - 4]; + isSet = strcmp(ptr, "_set") == 0; + } // OutputArrayMethod(className, el, out); OutputMemberReferenceMethod(className, isSet, el, out);