mirror of
https://github.com/espressif/esp-idf.git
synced 2025-08-01 03:34:32 +02:00
ldgen: Fix crash if --sections argument not supplied
This commit is contained in:
committed by
Angus Gratton
parent
e92e028679
commit
9f8587360c
@@ -73,14 +73,17 @@ def main():
|
|||||||
fragment_files = [] if not args.fragments else args.fragments
|
fragment_files = [] if not args.fragments else args.fragments
|
||||||
config_file = args.config
|
config_file = args.config
|
||||||
output_path = args.output
|
output_path = args.output
|
||||||
sections_info_files = [] if not args.sections else args.sections
|
|
||||||
kconfig_file = args.kconfig
|
kconfig_file = args.kconfig
|
||||||
|
sections = args.sections
|
||||||
|
|
||||||
try:
|
try:
|
||||||
sections_infos = SectionsInfo()
|
sections_infos = SectionsInfo()
|
||||||
|
|
||||||
section_info_contents = [s.strip() for s in sections_info_files.read().split("\n")]
|
if sections:
|
||||||
section_info_contents = [s for s in section_info_contents if s]
|
section_info_contents = [s.strip() for s in sections.read().split("\n")]
|
||||||
|
section_info_contents = [s for s in section_info_contents if s]
|
||||||
|
else:
|
||||||
|
section_info_contents = []
|
||||||
|
|
||||||
for sections_info_file in section_info_contents:
|
for sections_info_file in section_info_contents:
|
||||||
with open(sections_info_file) as sections_info_file_obj:
|
with open(sections_info_file) as sections_info_file_obj:
|
||||||
|
Reference in New Issue
Block a user