(index, rindex): Obsolete BSDisms; remove. Use standard strchr() and

strrchr() instead.
(setbuffer): Obsolete BSDism, unused; remove.
This commit is contained in:
Markus Armbruster 2004-01-08 18:15:13 +00:00
parent 4ae9c417b3
commit 64afd7747b
16 changed files with 29 additions and 227 deletions

View file

@ -52,44 +52,6 @@ char *_c_copyright_header =
char *_ipglob_copyright_header =
"/*\n * Empire - A multi-player, client/server Internet based war game.\n * Copyright (C) 1986-2000, Dave Pare, Jeff Bailey, Thomas Ruschak,\n * Ken Stevens, Steve McClure\n *\n * This program is free software; you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation; either version 2 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program; if not, write to the Free Software\n * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA\n *\n * ---\n *\n * See the \"LEGAL\", \"LICENSE\", \"CREDITS\" and \"README\" files for all the\n * related information and legal notices. It is expected that any future\n * projects/authors will amend these files as needed.\n *\n * ---\n *\n * ipglob.c: This is an auto-generated file.\n * \n * Known contributors to this file:\n * Automatically generated by doconfig.c\n */\n\n";
#if defined(_WIN32)
char *
rindex(char *path, char c)
{
int i;
char *cp;
i = strlen(path);
cp = &path[i - 1];
while (i) {
if (*cp == c)
return cp;
i--;
cp--;
}
return (char *)0;
}
char *
index(char *path, char c)
{
int i;
char *cp;
cp = &path[0];
i = 0;
while (path[i]) {
if (*cp == c)
return cp;
i++;
cp++;
}
return (char *)0;
}
#endif
int
main()
@ -103,14 +65,14 @@ main()
exit(-1);
}
#if !defined(_WIN32)
cp = (char *)rindex(pathname, '/');
cp = strrchr(pathname, '/');
*cp = '\0';
cp = (char *)rindex(pathname, '/');
cp = strrchr(pathname, '/');
*cp = '\0';
#else
cp = (char *)rindex(pathname, '\\');
cp = strrchr(pathname, '\\');
*cp = '\0';
cp = (char *)rindex(pathname, '\\');
cp = strrchr(pathname, '\\');
*cp = '\0';
#endif
printf("Configuring...\n");
@ -227,7 +189,7 @@ wrgamesdef(char *filename)
strcpy(buf, EF);
if (strlen(buf) > 0)
c = buf[strlen(buf) - 1];
if (index("dhm", c) && strlen(buf) > 0) {
if (strchr("dhm", c) && strlen(buf) > 0) {
s_p_etu = atoi(buf);
if (c == 'd')
s_p_etu =