mirror of https://github.com/weiju/amiga-stuff
dalf: read_string_list() now based on read_string()
This commit is contained in:
parent
ef21260fd4
commit
05a19685b6
|
@ -47,15 +47,6 @@ def read_int16(infile):
|
|||
def read_uint16(infile):
|
||||
return struct.unpack('>H', infile.read(2))[0]
|
||||
|
||||
def read_string_list(infile):
|
||||
result = []
|
||||
strlen = read_int32(infile)
|
||||
while strlen > 0:
|
||||
result.append(str(infile.read(strlen)))
|
||||
strlen = read_int32(infile)
|
||||
|
||||
return []
|
||||
|
||||
|
||||
def read_string(infile):
|
||||
result = None
|
||||
|
@ -67,6 +58,15 @@ def read_string(infile):
|
|||
return result[:idx]
|
||||
|
||||
|
||||
def read_string_list(infile):
|
||||
result = []
|
||||
s = read_string(infile)
|
||||
while s is not None:
|
||||
result.append(s)
|
||||
s = read_string(infile)
|
||||
return result
|
||||
|
||||
|
||||
def read_symbols(infile):
|
||||
result = []
|
||||
symbol = read_string(infile)
|
||||
|
|
Loading…
Reference in New Issue