mirror of
https://github.com/ZDoom/acc.git
synced 2025-01-30 19:00:40 +00:00
- Do not allow scripts to be named "None".
SVN r3391 (trunk)
This commit is contained in:
parent
2c34cdee72
commit
14c7636374
5 changed files with 11 additions and 5 deletions
1
error.c
1
error.c
|
@ -177,6 +177,7 @@ static struct
|
|||
{ ERR_UNCLOSED_WITH_ARGS, "Most special scripts must not have arguments." },
|
||||
{ ERR_NOT_A_CHAR_ARRAY, "%s has %d dimensions. Use %d subscripts to get a char array." },
|
||||
{ ERR_CANT_FIND_INCLUDE, "Couldn't find include file \"%s\"." },
|
||||
{ ERR_SCRIPT_NAMED_NONE, "Scripts may not be named \"None\"." },
|
||||
{ ERR_NONE, NULL }
|
||||
};
|
||||
|
||||
|
|
3
error.h
3
error.h
|
@ -144,7 +144,8 @@ typedef enum
|
|||
ERR_DISCONNECT_NEEDS_1_ARG,
|
||||
ERR_UNCLOSED_WITH_ARGS,
|
||||
ERR_NOT_A_CHAR_ARRAY,
|
||||
ERR_CANT_FIND_INCLUDE
|
||||
ERR_CANT_FIND_INCLUDE,
|
||||
ERR_SCRIPT_NAMED_NONE,
|
||||
} error_t;
|
||||
|
||||
// PUBLIC FUNCTION PROTOTYPES ----------------------------------------------
|
||||
|
|
4
misc.h
4
misc.h
|
@ -15,6 +15,10 @@
|
|||
|
||||
// MACROS ------------------------------------------------------------------
|
||||
|
||||
#ifdef _WIN32
|
||||
#define strcasecmp stricmp
|
||||
#endif
|
||||
|
||||
// TYPES -------------------------------------------------------------------
|
||||
|
||||
typedef enum
|
||||
|
|
4
parse.c
4
parse.c
|
@ -560,6 +560,10 @@ static void OuterScript(void)
|
|||
}
|
||||
else if(tk_Token == TK_STRING)
|
||||
{ // Named scripts start counting at -1 and go down from there.
|
||||
if(strcasecmp("None", tk_String) == 0)
|
||||
{
|
||||
ERR_Error(ERR_SCRIPT_NAMED_NONE, YES, NULL);
|
||||
}
|
||||
scriptNumber = -1 - STR_FindInListInsensitive(STRLIST_NAMEDSCRIPTS, tk_String);
|
||||
TK_NextToken();
|
||||
}
|
||||
|
|
|
@ -17,10 +17,6 @@
|
|||
|
||||
// MACROS ------------------------------------------------------------------
|
||||
|
||||
#ifdef _WIN32
|
||||
#define strcasecmp stricmp
|
||||
#endif
|
||||
|
||||
// TYPES -------------------------------------------------------------------
|
||||
|
||||
typedef struct
|
||||
|
|
Loading…
Reference in a new issue