GP-5707 fix getinfo FSB action project index

Also tweak tar filename info string
This commit is contained in:
dev747368
2025-05-20 18:05:53 +00:00
parent 795d92cb1a
commit 2c894df34c
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(