1
0
Fork 0

Merge pull request #3610 from oxqnd/fix/label-whitespace-bug

Fix: Trim trailing whitespace in script labels #3589
This commit is contained in:
Duncan Ogilvie 2025-06-30 17:02:32 +02:00 committed by GitHub
commit 65a087982b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 5 additions and 0 deletions

View File

@ -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;