From 195d41d1d912d6a432a4fb1054ad4e2fc8f63eae Mon Sep 17 00:00:00 2001 From: Alex Szpakowski Date: Mon, 3 Nov 2014 16:34:18 -0400 Subject: [PATCH] Ignore lines starting with "#" when parsing the mappings string given to love.joystick.loadGamepadMappings. --- src/modules/joystick/sdl/JoystickModule.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/modules/joystick/sdl/JoystickModule.cpp b/src/modules/joystick/sdl/JoystickModule.cpp index 87435b266..1aefec5c2 100644 --- a/src/modules/joystick/sdl/JoystickModule.cpp +++ b/src/modules/joystick/sdl/JoystickModule.cpp @@ -489,6 +489,10 @@ void JoystickModule::loadGamepadMappings(const std::string &mappings) if (mapping.empty()) continue; + // Lines starting with "#" are comments. + if (mapping[0] == '#') + continue; + // Strip out and compare any "platform:XYZ," in the mapping. size_t pstartpos = mapping.find("platform:"); if (pstartpos != std::string::npos)