Browse Source

Merge pull request #418 from kwhatmough/next

Fixes whitespace in properties #389.
Sean Paul Taylor 13 năm trước cách đây
mục cha
commit
be817055e1
1 tập tin đã thay đổi với 4 bổ sung1 xóa
  1. 4 1
      gameplay/src/Properties.cpp

+ 4 - 1
gameplay/src/Properties.cpp

@@ -134,13 +134,16 @@ void Properties::readProperties(FILE* file)
                 rc = strchr(line, '}');
                 rc = strchr(line, '}');
 
 
                 // First token should be the property name.
                 // First token should be the property name.
-                name = strtok(line, " =\t");
+                name = strtok(line, "=");
                 if (name == NULL)
                 if (name == NULL)
                 {
                 {
                     GP_ERROR("Error parsing properties file: attribute without name.");
                     GP_ERROR("Error parsing properties file: attribute without name.");
                     return;
                     return;
                 }
                 }
 
 
+                // Remove white-space from name.
+                name = trimWhiteSpace(name);
+
                 // Scan for next token, the property's value.
                 // Scan for next token, the property's value.
                 value = strtok(NULL, "=");
                 value = strtok(NULL, "=");
                 if (value == NULL)
                 if (value == NULL)