Skip to content

Commit

Permalink
The name of the decompressed file is now the name of the compressed f…
Browse files Browse the repository at this point in the history
…ile minua the knz extension
  • Loading branch information
flanglet committed Nov 16, 2024
1 parent 8cb467e commit 021d16a
Showing 1 changed file with 18 additions and 4 deletions.
22 changes: 18 additions & 4 deletions v2/app/BlockDecompressor.go
Original file line number Diff line number Diff line change
Expand Up @@ -394,11 +394,18 @@ func (this *BlockDecompressor) Decompress() (int, uint64) {
} else {
iName = files[0].FullPath
ctx["fileSize"] = files[0].Size
tmpName := iName

if len(tmpName) >= 4 && strings.EqualFold(tmpName[len(tmpName)-4:], ".KNZ") {
tmpName = tmpName[0 : len(tmpName)-4]
} else {
tmpName = tmpName + ".bak"
}

if len(oName) == 0 {
oName = iName + ".bak"
oName = tmpName
} else if inputIsDir == true && specialOutput == false {
oName = formattedOutName + iName[len(formattedInName):] + ".bak"
oName = formattedOutName + tmpName[len(formattedInName):]
}
}

Expand All @@ -420,11 +427,18 @@ func (this *BlockDecompressor) Decompress() (int, uint64) {
for i, f := range files {
iName := f.FullPath
oName := formattedOutName
tmpName := iName

if len(tmpName) >= 4 && strings.EqualFold(tmpName[len(tmpName)-4:], ".KNZ") {
tmpName = tmpName[0 : len(tmpName)-4]
} else {
tmpName = tmpName + ".bak"
}

if len(oName) == 0 {
oName = iName + ".bak"
oName = tmpName
} else if inputIsDir == true && specialOutput == false {
oName = formattedOutName + iName[len(formattedInName):] + ".bak"
oName = formattedOutName + tmpName[len(formattedInName):]
}

taskCtx := make(map[string]any)
Expand Down

0 comments on commit 021d16a

Please sign in to comment.