Fix setup crash, if partition table entries are not in disk order

This commit is contained in:
Fierelier 2023-08-22 15:15:00 +02:00
parent 8afb5390c8
commit f71df24cd3

View File

@ -121,16 +121,22 @@ def getDiskTable(disk):
length = len(results)
index = length - 1
while index >= 0:
if results[index] == "": break
if results[index] != "" and results[index][0] != "/": break
index -= 1
if index < 0: return {}
results = results[index + 2:]
results = results[index + 1:]
length = len(results)
index = 0
while index < length:
while results[index].replace(" "," ") != results[index]:
results[index] = results[index].replace(" "," ")
if results[index] == "" or results[index][0] != "/":
del results[index]
length -= 1
continue
results[index] = results[index].split(" ")
index += 1