mirror of
https://github.com/paleotronic/diskm8.git
synced 2024-12-21 03:29:58 +00:00
fix(disk/diskimagepas.go): trim filename strings
This commit is contained in:
parent
824eac4ce5
commit
613b5f1cd1
@ -137,7 +137,9 @@ func (pvh *PascalVolumeHeader) GetNameLength() int {
|
||||
|
||||
func (pvh *PascalVolumeHeader) GetName() string {
|
||||
l := pvh.GetNameLength()
|
||||
return string(pvh.data[0x07 : 0x07+l])
|
||||
s := strings.Trim(string(pvh.data[0x07:0x07+l]), " ")
|
||||
s += "." + PascalFileType(pvh.GetType()).Ext()
|
||||
return s
|
||||
}
|
||||
|
||||
func (pvh *PascalVolumeHeader) GetTotalBlocks() int {
|
||||
@ -182,7 +184,7 @@ func (pvh *PascalFileEntry) GetNameLength() int {
|
||||
|
||||
func (pvh *PascalFileEntry) GetName() string {
|
||||
l := pvh.GetNameLength()
|
||||
return string(pvh.data[0x07 : 0x07+l])
|
||||
return strings.Trim(string(pvh.data[0x07:0x07+l]), "")
|
||||
}
|
||||
|
||||
func (pvh *PascalFileEntry) GetBytesRemaining() int {
|
||||
|
Loading…
Reference in New Issue
Block a user