Commit 858eaab5 by devttys0

Fixed hexdiff bug introduced by previous patch.

parent 0c62122f
...@@ -328,7 +328,7 @@ class Module(object): ...@@ -328,7 +328,7 @@ class Module(object):
return args return args
def next_file(self): def next_file(self, close_previous=True):
''' '''
Gets the next file to be scanned (including pending extracted files, if applicable). Gets the next file to be scanned (including pending extracted files, if applicable).
Also re/initializes self.status. Also re/initializes self.status.
...@@ -337,6 +337,7 @@ class Module(object): ...@@ -337,6 +337,7 @@ class Module(object):
fp = None fp = None
# Ensure files are close to prevent IOError (too many open files) # Ensure files are close to prevent IOError (too many open files)
if close_previous:
try: try:
self.previous_next_file_fp.close() self.previous_next_file_fp.close()
except KeyboardInterrupt as e: except KeyboardInterrupt as e:
......
...@@ -185,7 +185,13 @@ class HexDiff(Module): ...@@ -185,7 +185,13 @@ class HexDiff(Module):
self.block = self.DEFAULT_BLOCK_SIZE self.block = self.DEFAULT_BLOCK_SIZE
# Build a list of files to hexdiff # Build a list of files to hexdiff
self.hex_target_files = [x for x in iter(self.next_file, None)] self.hex_target_files = []
while True:
f = self.next_file(close_previous=False)
if not f:
break
else:
self.hex_target_files.append(f)
# Build the header format string # Build the header format string
header_width = (self.block * 4) + 2 header_width = (self.block * 4) + 2
......
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