Avoid assigning the token to an str

This commit is contained in:
smallmodel 2023-08-19 21:17:52 +02:00
parent a307450e17
commit 3089cc8bc3
No known key found for this signature in database
GPG key ID: A96F163ED4891440

View file

@ -502,8 +502,8 @@ qboolean Script::AtAssignment(qboolean crossline)
const char *Script::GetToken(qboolean crossline)
{
str token_p = token;
qboolean is_Macro = false;
const char* token_p = token;
qboolean is_Macro = false;
// is a token already waiting?
if (tokenready) {
@ -515,9 +515,9 @@ const char *Script::GetToken(qboolean crossline)
token_p = GrabNextToken(crossline);
if (is_Macro && (token_p != "$include")) {
if (is_Macro && (strcmp(token_p, "$include") != 0)) {
// Check to see if we need to add any definitions
while ((token_p == "$define") || (token_p == "$Define")) {
while ((!strcmp(token_p, "$define")) || (!strcmp(token_p, "$Define"))) {
AddMacroDefinition(crossline);
is_Macro = isMacro();
// if ( !is_Macro )
@ -526,7 +526,7 @@ const char *Script::GetToken(qboolean crossline)
}
// Check to see if we need return any defines strings
if (is_Macro && (token_p != "$include") && (token_p[token_p.length() - 1] == '$')) {
if (is_Macro && (strcmp(token_p, "$include") != 0) && (token_p[strlen(token_p) - 1] == '$')) {
return GetMacroString(token_p);
}
}