Commit df702e86 authored by tikuta's avatar tikuta Committed by Commit bot

Print . for 127(DEL)

BUG=

Review-Url: https://codereview.chromium.org/2811093002
Cr-Commit-Position: refs/heads/master@{#464334}
parent 498d42bc
...@@ -131,7 +131,7 @@ def diff_binary(first_filepath, second_filepath, file_len): ...@@ -131,7 +131,7 @@ def diff_binary(first_filepath, second_filepath, file_len):
result = '%d out of %d bytes are different (%.2f%%)' % ( result = '%d out of %d bytes are different (%.2f%%)' % (
diffs, file_len, 100.0 * diffs / file_len) diffs, file_len, 100.0 * diffs / file_len)
if streams: if streams:
encode = lambda text: ''.join(i if 31 < ord(i) < 128 else '.' for i in text) encode = lambda text: ''.join(i if 31 < ord(i) < 127 else '.' for i in text)
for offset, lhs_data, rhs_data in streams: for offset, lhs_data, rhs_data in streams:
lhs_line = '%s \'%s\'' % (lhs_data.encode('hex'), encode(lhs_data)) lhs_line = '%s \'%s\'' % (lhs_data.encode('hex'), encode(lhs_data))
rhs_line = '%s \'%s\'' % (rhs_data.encode('hex'), encode(rhs_data)) rhs_line = '%s \'%s\'' % (rhs_data.encode('hex'), encode(rhs_data))
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment