Fix just |[scale] models not working. (Thanks 123DMWM)

This commit is contained in:
UnknownShadow200 2018-11-07 12:02:28 +11:00
parent b4b9c229bc
commit 8447c1fe0d

View File

@ -79,8 +79,7 @@ int String_UNSAFE_Split(STRING_REF const String* str, char c, String* subs, int
bool String_UNSAFE_Separate(STRING_REF const String* str, char c, String* key, String* value) { bool String_UNSAFE_Separate(STRING_REF const String* str, char c, String* key, String* value) {
int idx = String_IndexOf(str, c, 0); int idx = String_IndexOf(str, c, 0);
/* a) missing [c] or no key b) missing value */ if (idx == -1) {
if (idx <= 0 || (idx + 1) >= str->length) {
*key = *str; *key = *str;
*value = String_Empty; *value = String_Empty;
return false; return false;
@ -92,7 +91,7 @@ bool String_UNSAFE_Separate(STRING_REF const String* str, char c, String* key, S
/* Trim key [c] value to just key[c]value */ /* Trim key [c] value to just key[c]value */
String_TrimEnd(key); String_TrimEnd(key);
String_TrimStart(value); String_TrimStart(value);
return true; return key->length > 0 && value->length > 0;
} }