From 7654907e1e4dfce096091f61cbdf4bb898225ab0 Mon Sep 17 00:00:00 2001 From: Damien George Date: Thu, 9 Apr 2020 17:33:36 +1000 Subject: [PATCH] py/makecompresseddata.py: Don't prefix str with mark if not compressed. --- py/makecompresseddata.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/py/makecompresseddata.py b/py/makecompresseddata.py index 26d6703a9e..28223a6d9c 100644 --- a/py/makecompresseddata.py +++ b/py/makecompresseddata.py @@ -168,7 +168,11 @@ def main(collected_path, fn): # Print the replacements. for uncomp, comp in error_strings.items(): - print('MP_MATCH_COMPRESSED("{}", "\\{:03o}{}")'.format(uncomp, _COMPRESSED_MARKER, comp)) + if uncomp == comp: + prefix = "" + else: + prefix = "\\{:03o}".format(_COMPRESSED_MARKER) + print('MP_MATCH_COMPRESSED("{}", "{}{}")'.format(uncomp, prefix, comp)) # Used to calculate the "true" length of the (escaped) compressed strings. def unescape(s):