Skip to content

Commit 9cc7cfc

Browse files
committed
fixing a glitch at zipping files
1 parent 4324c7e commit 9cc7cfc

File tree

1 file changed

+2
-2
lines changed
  • app/src/main/kotlin/com/simplemobiletools/filemanager/pro/adapters

1 file changed

+2
-2
lines changed

app/src/main/kotlin/com/simplemobiletools/filemanager/pro/adapters/ItemsAdapter.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -439,7 +439,7 @@ class ItemsAdapter(activity: SimpleActivity, var listItems: MutableList<ListItem
439439
val fileDirItems = ArrayList<FileDirItem>()
440440
while (entries.hasMoreElements()) {
441441
val entry = entries.nextElement()
442-
val currPath = if (entry.isDirectory) it else "${it.getParentPath()}${entry.name}"
442+
val currPath = if (entry.isDirectory) it else "${it.getParentPath().trimEnd('/')}/${entry.name}"
443443
val fileDirItem = FileDirItem(currPath, entry.name, entry.isDirectory, 0, entry.size)
444444
fileDirItems.add(fileDirItem)
445445
}
@@ -462,7 +462,7 @@ class ItemsAdapter(activity: SimpleActivity, var listItems: MutableList<ListItem
462462
val zipFile = ZipFile(it)
463463
val entries = zipFile.entries()
464464
val zipFileName = it.getFilenameFromPath()
465-
val newFolderName = zipFileName.subSequence(0, zipFileName.length-4)
465+
val newFolderName = zipFileName.subSequence(0, zipFileName.length - 4)
466466
while (entries.hasMoreElements()) {
467467
val entry = entries.nextElement()
468468
val parentPath = it.getParentPath()

0 commit comments

Comments
 (0)