ext/rjb.c in rjb-1.6.9 vs ext/rjb.c in rjb-1.7.0

- old
+ new

@@ -12,11 +12,11 @@ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * */ -#define RJB_VERSION "1.6.9" +#define RJB_VERSION "1.7.0" #include "ruby.h" #include "extconf.h" #if RJB_RUBY_VERSION_CODE < 190 #include "st.h" @@ -183,14 +183,19 @@ } static char* java2jniname(char* jnicls) { char* p; + int found_class_separator = isupper(*jnicls) ? 1 : 0; for (p = jnicls; *p; p++) { if (*p == '.') { - *p = '/'; + if (isupper(*(p + 1))) + { + found_class_separator++; + } + *p = (found_class_separator <= 1) ? '/' : '$'; } } return jnicls; }