mirror of
https://github.com/Luzifer/scs-extract.git
synced 2024-12-20 05:21:16 +00:00
Add support for locale.scs file
Signed-off-by: Knut Ahlers <knut@ahlers.me>
This commit is contained in:
parent
71fc401a28
commit
17f7157885
1 changed files with 11 additions and 4 deletions
15
scs/scs.go
15
scs/scs.go
|
@ -11,11 +11,15 @@ import (
|
|||
"reflect"
|
||||
"strings"
|
||||
|
||||
"github.com/Luzifer/scs-extract/b0rkhash"
|
||||
"github.com/pkg/errors"
|
||||
|
||||
"github.com/Luzifer/scs-extract/b0rkhash"
|
||||
)
|
||||
|
||||
var rootPathHash = b0rkhash.CityHash64([]byte(""))
|
||||
var (
|
||||
localeRootPathHash = b0rkhash.CityHash64([]byte("locale"))
|
||||
rootPathHash = b0rkhash.CityHash64([]byte(""))
|
||||
)
|
||||
|
||||
type CatalogEntry struct {
|
||||
HashedPath uint64
|
||||
|
@ -123,6 +127,11 @@ func (r *Reader) populateFileNames() error {
|
|||
for _, e := range r.Files {
|
||||
if e.HashedPath == rootPathHash {
|
||||
entry = e
|
||||
entry.Name = ""
|
||||
break
|
||||
} else if e.HashedPath == localeRootPathHash {
|
||||
entry = e
|
||||
entry.Name = "locale"
|
||||
break
|
||||
}
|
||||
}
|
||||
|
@ -136,8 +145,6 @@ func (r *Reader) populateFileNames() error {
|
|||
return errors.New("No root path entry found or root path empty")
|
||||
}
|
||||
|
||||
entry.Name = ""
|
||||
|
||||
return r.populateFileTree(entry)
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue