Merge pull request #3610 from oxqnd/fix/label-whitespace-bug
Fix: Trim trailing whitespace in script labels #3589
This commit is contained in:
commit
65a087982b
|
@ -208,6 +208,11 @@ static bool scriptcreatelinemap(const char* filename)
|
||||||
}
|
}
|
||||||
|
|
||||||
int rawlen = (int)strlen(cur.raw);
|
int rawlen = (int)strlen(cur.raw);
|
||||||
|
while ((rawlen > 0) && isspace(cur.raw[rawlen - 1])) //Trim trailing whitespace
|
||||||
|
{
|
||||||
|
rawlen--;
|
||||||
|
}
|
||||||
|
cur.raw[rawlen] = '\0'; //// Truncate the string by setting a new null terminator
|
||||||
if(!rawlen) //empty
|
if(!rawlen) //empty
|
||||||
{
|
{
|
||||||
cur.type = lineempty;
|
cur.type = lineempty;
|
||||||
|
|
Loading…
Reference in New Issue