Navigation Menu

Skip to content

Commit

Permalink
Fixed gamecontroller database sorting script not sorting the whole da…
Browse files Browse the repository at this point in the history
…tabase.

The script was originally written for an SDL_gamecontrollerdb.h which had groups
of mappings separated by single lines starting with a "#". This was changed some
time ago to #endif/#if pairs. Because the script assumed only a single #endif in
the whole file it no longer worked correctly and only processed the first group.
  • Loading branch information
philippwiesemann committed Oct 29, 2014
1 parent 0c60f02 commit 37720dd
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/joystick/sort_controllers.py
Expand Up @@ -40,15 +40,17 @@ def write_controllers():
controller_guids = {}

for line in input:
if ( parsing_controllers ):
if (parsing_controllers):
if (line.startswith("{")):
output.write(line)
elif (line.startswith("#endif")):
elif (line.startswith(" NULL")):
parsing_controllers = False
write_controllers()
output.write(line)
elif (line.startswith("#")):
elif (line.startswith("#if")):
print("Parsing " + line.strip())
output.write(line)
elif (line.startswith("#endif")):
write_controllers()
output.write(line)
else:
Expand Down

0 comments on commit 37720dd

Please sign in to comment.