Move TrimWhitespace from core to logic.

This commit is contained in:
David Anderson
2015-08-30 18:42:25 -07:00
parent c261bb0b2e
commit 9d2bee261c
7 changed files with 35 additions and 35 deletions
-30
View File
@@ -1304,36 +1304,6 @@ char *sm_strdup(const char *str)
return ptr;
}
char *UTIL_TrimWhitespace(char *str, size_t &len)
{
char *end = str + len - 1;
if (!len)
{
return str;
}
/* Iterate backwards through string until we reach first non-whitespace char */
while (end >= str && textparsers->IsWhitespace(end))
{
end--;
len--;
}
/* Replace first whitespace char (at the end) with null terminator.
* If there is none, we're just replacing the null terminator.
*/
*(end + 1) = '\0';
while (*str != '\0' && textparsers->IsWhitespace(str))
{
str++;
len--;
}
return str;
}
char *UTIL_ToLowerCase(const char *str)
{
size_t len = strlen(str);