bug 890900, multiple %1$S in printf are OK, r=stas
authorAxel Hecht <axel@pike.org>
Thu, 31 Aug 2017 23:02:40 +0200
changeset 315 43bdbd3bcf193d056862f9531e302b784398b2ac
parent 313 77cb0f991b869548313b55b3ffd687007b3129b8
child 316 8c37c00ca2e548ff6902a9edda8daacc34f58a09
child 317 b2fdbcb66a6087f13cca2c70d4edde64792a2ec9
child 318 4e52816a3e210b93d9a6db0cf3dd4a56cf182cb9
push id97
push useraxel@mozilla.com
push dateThu, 31 Aug 2017 21:26:06 +0000
reviewersstas
bugs890900, 438688, 1388789
bug 890900, multiple %1$S in printf are OK, r=stas This corresponds to bug 438688 and a GTEST like // Double referencing existing argument works out.Adopt(nsTextFormatter::smprintf(u"%1$S %1$S", u"1")); EXPECT_STREQ("1 1", NS_ConvertUTF16toUTF8(out).get()); from bug 1388789. I'd test this if I had corresponding tests on the gecko impl, but those are hard to get to. MozReview-Commit-ID: 29VZFFJYkFj
compare_locales/checks.py
--- a/compare_locales/checks.py
+++ b/compare_locales/checks.py
@@ -167,20 +167,16 @@ class PropertiesChecker(Checker):
                 pos = int(m.group('number')) - 1
                 ls = len(specs)
                 if pos >= ls:
                     # pad specs
                     nones = pos - ls
                     specs[ls:pos] = nones*[None]
                     specs.append(m.group('spec'))
                 else:
-                    if specs[pos] is not None:
-                        raise PrintfException('Double ordered argument %d' %
-                                              (pos+1),
-                                              m.start())
                     specs[pos] = m.group('spec')
             else:
                 specs.append(m.group('spec'))
         # check for missing args
         if hasNumber and not all(specs):
             raise PrintfException('Ordered argument missing', 0)
         return specs