- Remove Q_strrchr(), replace with standard, portable strrchr()

- Add strrchr() to bg_lib.c, patch by DevHC
This commit is contained in:
Thilo Schulz 2011-05-15 14:08:03 +00:00
parent 3ddc59a3ba
commit b509d770a7
12 changed files with 27 additions and 29 deletions

View file

@ -1022,7 +1022,7 @@ qboolean FS_IsDemoExt(const char *filename, int namelen)
char *ext_test;
int index, protocol;
ext_test = Q_strrchr(filename, '.');
ext_test = strrchr(filename, '.');
if(ext_test && !Q_stricmpn(ext_test + 1, DEMOEXT, ARRAY_LEN(DEMOEXT) - 1))
{
protocol = atoi(ext_test + ARRAY_LEN(DEMOEXT));

View file

@ -683,26 +683,6 @@ int Q_isalpha( int c )
return ( 0 );
}
char* Q_strrchr( const char* string, int c )
{
char cc = c;
char *s;
char *sp=(char *)0;
s = (char*)string;
while (*s)
{
if (*s == cc)
sp = s;
s++;
}
if (cc == 0)
sp = s;
return sp;
}
qboolean Q_isanumber( const char *s )
{
char *p;

View file

@ -734,7 +734,6 @@ int Q_strncmp (const char *s1, const char *s2, int n);
int Q_stricmpn (const char *s1, const char *s2, int n);
char *Q_strlwr( char *s1 );
char *Q_strupr( char *s1 );
char *Q_strrchr( const char* string, int c );
const char *Q_stristr( const char *s, const char *find);
// buffer size safe library replacements