diff --git a/source/cl_main.c b/source/cl_main.c index 2475fdc..f2a0a07 100644 --- a/source/cl_main.c +++ b/source/cl_main.c @@ -609,7 +609,7 @@ CL_FullServerinfo_f (void) Con_Printf ("Invalid QSG Protocol number: %s\n", p); } if ((p = Info_ValueForKey (cl.serverinfo, "skybox")) && *p) { - if (stricmp (p, "none") == 0) { + if (strcaseequal (p, "none")) { allowskybox = false; } else { allowskybox = true; @@ -707,7 +707,7 @@ CL_FullInfo_f (void) if (*s) s++; - if (!stricmp (key, pmodel_name) || !stricmp (key, emodel_name)) + if (strcaseequal (key, pmodel_name) || strcaseequal (key, emodel_name)) continue; Info_SetValueForKey (cls.userinfo, key, value, MAX_INFO_STRING); @@ -730,8 +730,9 @@ CL_SetInfo_f (void) Con_Printf ("usage: setinfo [ ]\n"); return; } - if (!stricmp (Cmd_Argv (1), pmodel_name) - || !strcmp (Cmd_Argv (1), emodel_name)) return; + if (strcaseequal (Cmd_Argv (1), pmodel_name) + || strcaseequal (Cmd_Argv (1), emodel_name)) + return; Info_SetValueForKey (cls.userinfo, Cmd_Argv (1), Cmd_Argv (2), MAX_INFO_STRING); diff --git a/source/cl_parse.c b/source/cl_parse.c index 6faaf9f..7c1e883 100644 --- a/source/cl_parse.c +++ b/source/cl_parse.c @@ -629,7 +629,7 @@ CL_ParseServerData (void) // game directory str = MSG_ReadString (); - if (stricmp (gamedirfile, str)) { + if (strcasecmp (gamedirfile, str)) { // save current config Host_WriteConfiguration (); cflag = true; diff --git a/source/gl_draw.c b/source/gl_draw.c index eb2e4b2..7ed7fb7 100644 --- a/source/gl_draw.c +++ b/source/gl_draw.c @@ -254,7 +254,7 @@ Draw_TextureMode_f (void) } for (i = 0; i < 6; i++) { - if (!stricmp (modes[i].name, Cmd_Argv (1))) + if (strcaseequal (modes[i].name, Cmd_Argv (1))) break; } if (i == 6) { diff --git a/source/gl_sky.c b/source/gl_sky.c index f645374..ca6e027 100644 --- a/source/gl_sky.c +++ b/source/gl_sky.c @@ -65,7 +65,7 @@ R_LoadSkys (char *skyname) QFile *f; char name[64]; - if (stricmp (skyname, "none") == 0) { + if (strcaseequal (skyname, "none")) { skyloaded = false; return; } diff --git a/source/info.c b/source/info.c index acd13cd..0a42c53 100644 --- a/source/info.c +++ b/source/info.c @@ -258,8 +258,8 @@ Info_SetValueForStarKey (char *s, char *key, char *value, size_t maxsize) // only copy ascii values s += strlen (s); v = newstr; - is_name = stricmp (key, "name") == 0; - is_team = stricmp (key, "team") == 0; + is_name = strcaseequal (key, "name"); + is_team = strcaseequal (key, "team"); while (*v) { c = (unsigned char) *v++; // client only allows highbits on name diff --git a/source/sv_ccmds.c b/source/sv_ccmds.c index 97d4264..58148a8 100644 --- a/source/sv_ccmds.c +++ b/source/sv_ccmds.c @@ -328,7 +328,7 @@ SV_Map_f (void) if (!f) { Con_Printf ("Can't find %s\n", expanded); // If curlevel == level, something is SCREWED! --KB - if (stricmp (level, curlevel) == 0) + if (strcaseequal (level, curlevel)) SV_Error ("map: cannot restart level\n"); else Cbuf_AddText (va ("map %s", curlevel)); diff --git a/source/sv_main.c b/source/sv_main.c index 9bb3eec..6ce50f5 100644 --- a/source/sv_main.c +++ b/source/sv_main.c @@ -704,7 +704,7 @@ SVC_DirectConnect (void) s = Info_ValueForKey (userinfo, "spectator"); if (s[0] && strcmp (s, "0")) { if (spectator_password->string[0] && - stricmp (spectator_password->string, "none") && + strcasecmp (spectator_password->string, "none") && strcmp (spectator_password->string, s)) { // failed Con_Printf ("%s:spectator password failed\n", NET_AdrToString (net_from)); @@ -719,7 +719,7 @@ SVC_DirectConnect (void) } else { s = Info_ValueForKey (userinfo, "password"); if (password->string[0] && - stricmp (password->string, "none") && strcmp (password->string, s)) { + strcasecmp (password->string, "none") && strcmp (password->string, s)) { Con_Printf ("%s:password failed\n", NET_AdrToString (net_from)); Netchan_OutOfBandPrint (net_from, "%c\nserver requires a password\n\n", @@ -1737,7 +1737,7 @@ SV_ExtractFromUserinfo (client_t *cl) val = Info_ValueForKey (cl->userinfo, "name"); } - if (!val[0] || !stricmp (val, "console")) { + if (!val[0] || strcaseequal (val, "console")) { Info_SetValueForKey (cl->userinfo, "name", "unnamed", MAX_INFO_STRING); val = Info_ValueForKey (cl->userinfo, "name"); } @@ -1746,7 +1746,7 @@ SV_ExtractFromUserinfo (client_t *cl) for (i = 0, client = svs.clients; i < MAX_CLIENTS; i++, client++) { if (client->state != cs_spawned || client == cl) continue; - if (!stricmp (client->name, val)) + if (strcaseequal (client->name, val)) break; } if (i != MAX_CLIENTS) { // dup name diff --git a/source/sv_progs.c b/source/sv_progs.c index a7bfba0..f750e11 100644 --- a/source/sv_progs.c +++ b/source/sv_progs.c @@ -120,11 +120,9 @@ ED_Parse_Extra_Fields (progs_t *pr, char *key, char *value) // If skyname is set, we want to allow skyboxes and set what // the skybox name should be. "qlsky" is supported since // at least one other map uses it already. --KB - if (stricmp (key, "sky") == 0 || // LordHavoc: added "sky" key - // (Quake2 and DarkPlaces use - // this) - stricmp (key, "skyname") == 0 || - stricmp (key, "qlsky") == 0) { + if (strcaseequal (key, "sky") + || strcaseequal (key, "skyname") + || strcaseequal (key, "qlsky")) { Info_SetValueForKey (svs.info, "skybox", "1", MAX_SERVERINFO_STRING); Cvar_Set (r_skyname, value); diff --git a/source/teamplay.c b/source/teamplay.c index eeef724..7362b9d 100644 --- a/source/teamplay.c +++ b/source/teamplay.c @@ -346,64 +346,68 @@ Team_Init_Cvars (void) void locs_loc (void) { - char *mapname; - char *desc = NULL; - char locfile[MAX_OSPATH]; + char *mapname; + char *desc = NULL; + char locfile[MAX_OSPATH]; - //FIXME checking needed to make sure you are actually in the game and a live. + // FIXME checking needed to make sure you are actually in the game and a live. if (Cmd_Argc () == 1) { Con_Printf ("loc [] :Modifies location data, add|rename take parameter\n"); return; } + if (Cmd_Argc () >= 3) - desc = Cmd_Args () + strlen(Cmd_Argv(1)) + 1; - mapname = malloc(sizeof(cl.worldmodel->name)); - if (!mapname) + desc = Cmd_Args () + strlen (Cmd_Argv (1)) + 1; + + if (!(mapname = malloc (sizeof (cl.worldmodel->name)))) Sys_Error ("Can't duplicate mapname!"); - map_to_loc(cl.worldmodel->name,mapname); + + map_to_loc (cl.worldmodel->name, mapname); snprintf (locfile, sizeof (locfile), "%s/%s", com_gamedir, mapname); - free(mapname); + free (mapname); - if (stricmp(Cmd_Argv(1),"save") == 0) { + if (strcaseequal (Cmd_Argv (1), "save")) { if (Cmd_Argc () == 2) { - locs_save(locfile, false); - } else - Con_Printf("loc save :saves locs from memory into a .loc file\n"); + locs_save (locfile, false); + } else { + Con_Printf ("loc save :saves locs from memory into a .loc file\n"); + } } - if (stricmp(Cmd_Argv(1),"zsave") == 0) { + if (strcaseequal (Cmd_Argv (1), "zsave")) { if (Cmd_Argc () == 2) { - locs_save(locfile, true); - } else - Con_Printf("loc save :saves locs from memory into a .loc file\n"); + locs_save (locfile, true); + } else { + Con_Printf ("loc save :saves locs from memory into a .loc file\n"); + } } - if (stricmp(Cmd_Argv(1),"add") == 0) { + if (strcaseequal (Cmd_Argv (1), "add")) { if (Cmd_Argc () >= 3) - locs_mark(cl.simorg,desc); + locs_mark (cl.simorg, desc); else - Con_Printf("loc add :marks the current location with the description and records the information into a loc file.\n"); + Con_Printf ("loc add :marks the current location with the description and records the information into a loc file.\n"); } - if (stricmp(Cmd_Argv(1),"rename") == 0) { + if (strcaseequal (Cmd_Argv (1), "rename")) { if (Cmd_Argc () >= 3) - locs_edit(cl.simorg,desc); + locs_edit (cl.simorg, desc); else - Con_Printf("loc rename :changes the description of the nearest location marker\n"); + Con_Printf ("loc rename :changes the description of the nearest location marker\n"); } - if (stricmp(Cmd_Argv(1),"delete") == 0) { + if (strcaseequal (Cmd_Argv (1), "delete")) { if (Cmd_Argc () == 2) - locs_del(cl.simorg); + locs_del (cl.simorg); else - Con_Printf("loc delete :removes nearest location marker\n"); + Con_Printf ("loc delete :removes nearest location marker\n"); } - if (stricmp(Cmd_Argv(1),"move") == 0) { + if (strcaseequal (Cmd_Argv (1), "move")) { if (Cmd_Argc () == 2) - locs_edit(cl.simorg,NULL); + locs_edit (cl.simorg, NULL); else - Con_Printf("loc move :moves the nearest location marker to your current location\n"); + Con_Printf ("loc move :moves the nearest location marker to your current location\n"); } }