glib-mkenums: Don't go into an infinite loop trying to find a matching {

If we reach EOF before this happens, error out as opposed to
looping around forever.

https://bugzilla.gnome.org/show_bug.cgi?id=794506
This commit is contained in:
Sam Spilsbury 2018-03-19 04:58:08 +08:00 committed by Philip Withnall
parent 7027a128c1
commit 5e02a9f8af

View File

@ -495,6 +495,8 @@ def process_file(curfilename):
if groups[0] is None and (len(groups) < 4 or groups[3] is None):
while True:
line = curfile.readline()
if not line:
print_error("Syntax error when looking for opening { in enum")
if re.match(r'\s*\{', line):
break