File tree Expand file tree Collapse file tree 1 file changed +2
-0
lines changed
core/src/main/java/org/jruby/util Expand file tree Collapse file tree 1 file changed +2
-0
lines changed Original file line number Diff line number Diff line change @@ -90,6 +90,7 @@ public class Sprintf {
9090 private static final String ERR_MALFORMED_DOT_NUM = "malformed format string - %.[0-9]" ;
9191 private static final String ERR_MALFORMED_STAR_NUM = "malformed format string - %*[0-9]" ;
9292 private static final String ERR_ILLEGAL_FORMAT_CHAR = "illegal format character - %" ;
93+ private static final String ERR_INCOMPLETE_FORMAT_SPEC = "incomplete format specifier; use %%%% (double %%) instead" ;
9394 private static final String ERR_MALFORMED_NAME = "malformed name - unmatched parenthesis" ;
9495
9596 private static final ThreadLocal <Map <Locale , NumberFormat >> LOCALE_NUMBER_FORMATS = new ThreadLocal <Map <Locale , NumberFormat >>();
@@ -1413,6 +1414,7 @@ else if ((flags & FLAG_MINUS) != 0) {
14131414 if (incomplete ) {
14141415 if (flags == FLAG_NONE ) {
14151416 // dangling '%' char
1417+ if (format [length - 1 ] == '%' ) raiseArgumentError (args ,ERR_INCOMPLETE_FORMAT_SPEC );
14161418 buf .append ('%' );
14171419 } else {
14181420 raiseArgumentError (args ,ERR_ILLEGAL_FORMAT_CHAR );
You can’t perform that action at this time.
0 commit comments