From c620c7bf397cf6d7e4f80cf09354eae7420235ed Mon Sep 17 00:00:00 2001 From: Francisco Ryan Tolmasky I Date: Sun, 9 Jan 2011 03:25:59 -0800 Subject: [PATCH] Fix for %% being broken in sprintf (minor bugfix for press message showing undefined, larger press bugs remain). Reviewed by me. --- Objective-J/sprintf.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/Objective-J/sprintf.js b/Objective-J/sprintf.js index 9ad4723a5..b90b1b785 100644 --- a/Objective-J/sprintf.js +++ b/Objective-J/sprintf.js @@ -42,10 +42,12 @@ exports.sprintf = function(format) } index += t.length; - if (t.charAt(0) != "%") - { + if (t.charAt(0) !== "%") result += t; - } + + else if (t === "%%") + result += "%"; + else { var subtokens = t.match(tagRegex);