Skip to content
Permalink
Browse files
[Truffle] Fixed a problem with format strings and literal '%'.
  • Loading branch information
nirvdrum committed Jan 15, 2015
1 parent bf361d9 commit 6a96437f7686aabd76a549d63f4124fe0ec3ac7a
Showing with 4 additions and 1 deletion.
  1. +4 −1 core/src/main/java/org/jruby/truffle/runtime/core/StringFormatter.java
@@ -187,7 +187,10 @@ public static void format(RubyContext context, PrintStream stream, String format
throw new RuntimeException("Kernel#sprintf error -- unknown format: " + type);
}

v++;
// Showing a literal '%' would not reference any particular value, so don't increment the value lookup index.
if (type != '%') {
v++;
}
} else {
stream.print(c);
}

0 comments on commit 6a96437

Please sign in to comment.