SheetJS / js-cfb

:floppy_disk: OLE File Container Format
https://sheetjs.com/cfb-editor
Apache License 2.0
69 stars 15 forks source link

build_full_paths does not prepend "root_entry/" if child is before parent #5

Closed rossj closed 5 years ago

rossj commented 5 years ago

I came across and issue where the returned FullPaths array from a cfb.parse call does not properly append the root name (root_entry/) to child nodes (with depth greater than 1) that appear before their parent node.

It seems that in such a situation, build_full_paths properly constructs the dad tree, but terminates the final path construction loop too early, before it has prepended root_entry/.

I have created and attached a sample file the demonstrates the issue.

The returned FullPaths array is:

[
    "Root Entry/",
    "some folder/some child",
    "Root Entry/some folder/"
]

Despite "some child" being a child of "some folder"

Here is the view from DFVIEW.EXE image

path-test.zip