diff options
author | Martin Mathieson <martin.mathieson@keysight.com> | 2020-08-09 13:04:44 +0100 |
---|---|---|
committer | Anders Broman <a.broman58@gmail.com> | 2020-08-09 13:31:33 +0000 |
commit | 9a7b30aea8cba8227346be25db3feeb1bb2cadfc (patch) | |
tree | 3ba99fde913e1651f89db508817326f2c53dbb28 /tools | |
parent | e9f6958c46c99536bd9bb9a09e824d0789681d0a (diff) |
Fix tfs strings that have leading or trailing space characters.
Change-Id: I3e456e24f171ea2073806ad56606e6ce9092890c
Reviewed-on: https://code.wireshark.org/review/38096
Petri-Dish: Martin Mathieson <martin.r.mathieson@googlemail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Pascal Quantin <pascal@wireshark.org>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
Diffstat (limited to 'tools')
-rwxr-xr-x | tools/check_tfs.py | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/tools/check_tfs.py b/tools/check_tfs.py index ecee47db3b..c38ada3b74 100755 --- a/tools/check_tfs.py +++ b/tools/check_tfs.py @@ -16,7 +16,6 @@ import signal # TODO: # - check how many of the definitions in epan/tfs.c are used in other dissectors # - see if there are other values that should be in epan/tfs.c and shared -# - look for leading/trailing whitespace in true/flase strings? # Try to exit soon after Ctrl-C is pressed. @@ -30,11 +29,18 @@ def signal_handler(sig, frame): signal.signal(signal.SIGINT, signal_handler) class TFS: - def __init__(self, file, val1, val2): + def __init__(self, file, name, val1, val2): self.file = file + self.name = name self.val1 = val1 self.val2 = val2 + # Do some extra checks on values. + if val1.startswith(' ') or val1.endswith(' '): + print('N.B.: file=' + self.file + ' ' + self.name + ' - false val begins or ends with space \"' + self.val1 + '\"') + if val2.startswith(' ') or val2.endswith(' '): + print('N.B.: file=' + self.file + ' ' + self.name + ' - true val begins or ends with space \"' + self.val2 + '\"') + def __str__(self): return '{' + self.val1 + ',' + self.val2 + '}' @@ -62,7 +68,7 @@ def find_items(filename): val1 = m.group(2) val2 = m.group(3) # Store this entry. - items[name] = TFS(filename, val1, val2) + items[name] = TFS(filename, name, val1, val2) return items |