forked from icsharpcode/SharpZipLib
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix icsharpcode#337 (tar): Files added under CurrentDirectory must re…
…spect RootPath This changes the behavior of TarArchive when files are added under the CurrentDirectory. When a TarEntry is created from a file which is under the CurrentDirectory, the path is made relative to the CurrentDirectory. This behavior affects how TarArchive removes a prefix from files set by the RootPath directory. The expectation for RootPath is that a matching substring will be removed from the prefix of entries before they are added to the TarArchive. Because the TarEntry for files under CurrentDirectory are modified, RootPath will not work if it is an absolute path under CurrentDirectory. This change fixes this behavior. If RootPath is a directory under CurrentDirectory, it will apply to entres added to TarArchive. An attempt was made to implement this change without additional string manipulation. This could be done with a modified IndexOf, that enables searching for a substring of the pattern within the target substring. This may improve performance.
- Loading branch information
1 parent
519ed73
commit 1719e91
Showing
2 changed files
with
137 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters