Merge remote-tracking branch 'origin/GP-5707_dev747368_fix_projectindex_ref_for_getinfo_action'

This commit is contained in:
Ryan Kurtz
2025-05-21 12:22:32 -04:00
4 changed files with 11 additions and 13 deletions
@@ -21,6 +21,7 @@ import java.io.IOException;
import org.apache.commons.compress.archivers.tar.TarArchiveEntry;
import org.apache.commons.compress.archivers.tar.TarArchiveInputStream;
import org.apache.commons.io.FilenameUtils;
import ghidra.app.util.bin.ByteProvider;
import ghidra.formats.gfilesystem.*;
@@ -112,7 +113,7 @@ public class TarFileSystem extends AbstractFileSystem<TarMetadata> {
}
TarArchiveEntry blob = tmd.tarArchiveEntry;
return FileAttributes.of(
FileAttribute.create(NAME_ATTR, blob.getName()),
FileAttribute.create(NAME_ATTR, FilenameUtils.getName(blob.getName())),
FileAttribute.create(SIZE_ATTR, blob.getSize()),
FileAttribute.create(MODIFIED_DATE_ATTR, blob.getLastModifiedDate()),
FileAttribute.create(FILE_TYPE_ATTR, tarToFileType(blob)),
@@ -155,7 +156,7 @@ public class TarFileSystem extends AbstractFileSystem<TarMetadata> {
int fileNum = 0;
TarArchiveEntry tarEntry;
while ((tarEntry = tarInput.getNextTarEntry()) != null) {
while ((tarEntry = tarInput.getNextEntry()) != null) {
if (fileNum == tmd.fileNum) {
if (!tmd.tarArchiveEntry.getName().equals(tarEntry.getName())) {
throw new IOException(