[Skiboot] [PATCH] fwts/generate-fwts-olog: Fix regex matches to allow more printf formats

Jeremy Kerr jk at ozlabs.org
Mon Jun 20 18:39:26 AEST 2016


We currently aren't handling the 'll' length modifier, or widths
starting with zero (eg %016x). The former is becase we have the shorter
'l' match in the group first (so borking on the second l). The latter is
because we don't allow a leading zero on width matches.

This change fixes those issues.

Signed-off-by: Jeremy Kerr <jk at ozlabs.org>
---
 external/fwts/generate-fwts-olog | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/external/fwts/generate-fwts-olog b/external/fwts/generate-fwts-olog
index c9d8259..7663d34 100755
--- a/external/fwts/generate-fwts-olog
+++ b/external/fwts/generate-fwts-olog
@@ -109,9 +109,9 @@ def message_to_pattern(loc, msg):
     # Somewhat-simplified match for a %-template
     template_re = re.compile(
             '%(?P<flag>[-#0 +]*)'
-            '(?P<width>(?:[1-9][0-9]*|\*))?'
+            '(?P<width>(?:[0-9]*|\*))?'
             '(?P<precision>\.*(?:[1-9][0-9]*|\*))?'
-            '(?:hh|h|l|ll|L|j|z|t)?'
+            '(?:hh|h|ll|l|L|j|z|t)?'
             '(?P<conversion>[a-zA-Z%])')
     global is_regex
     is_regex = False
-- 
2.5.0



More information about the Skiboot mailing list