Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions pyhindsight/browsers/chrome.py
Original file line number Diff line number Diff line change
Expand Up @@ -4216,7 +4216,10 @@ def get_file_system(self, path, dir_name):
}

path_parts = re.split(r'[/\\]', backing_file_path)
if path_parts != ['']:
# Need at least two segments to index [0] and [1]; a
# single-segment (or empty) path falls through to the else
# branch, which joins the path as-is.
if len(path_parts) >= 2:
normalized_backing_file_path = os.path.join(
path_nodes['0']['fs_path'], fs_type, path_parts[0], path_parts[1])
file_exists, file_size, magic_results = self.get_local_file_info(
Expand All @@ -4238,7 +4241,10 @@ def get_file_system(self, path, dir_name):
if not item['key'].startswith(b'CHILD_OF:'):
continue

parent, name = item['key'][9:].split(b':')
# Key format is CHILD_OF:<parent_id>:<name>. The name can itself
# contain ':' (e.g. a filename with a colon), so split only on the
# first delimiter; partition never raises if ':' is absent.
parent, _, name = item['key'][9:].partition(b':')

path_node_key = item['value'].decode()
if item['value'] == b'':
Expand Down
Loading