Skip to content

Commit

Permalink
[Truffle] Fixed a problem with format strings and literal '%'.
Browse files Browse the repository at this point in the history
  • Loading branch information
nirvdrum committed Jan 15, 2015
1 parent bf361d9 commit 6a96437
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down

0 comments on commit 6a96437

Please sign in to comment.