* Merge unified-sdl to trunk
* Bump Q3_VERSION to 1.35
This commit is contained in:
parent
39abffeb3b
commit
672cfbf16f
188 changed files with 5071 additions and 41739 deletions
|
@ -734,7 +734,6 @@ Safe strncpy that ensures a trailing zero
|
|||
=============
|
||||
*/
|
||||
void Q_strncpyz( char *dest, const char *src, int destsize ) {
|
||||
// bk001129 - also NULL dest
|
||||
if ( !dest ) {
|
||||
Com_Error( ERR_FATAL, "Q_strncpyz: NULL dest" );
|
||||
}
|
||||
|
@ -752,7 +751,6 @@ void Q_strncpyz( char *dest, const char *src, int destsize ) {
|
|||
int Q_stricmpn (const char *s1, const char *s2, int n) {
|
||||
int c1, c2;
|
||||
|
||||
// bk001129 - moved in 1.17 fix not in id codebase
|
||||
if ( s1 == NULL ) {
|
||||
if ( s2 == NULL )
|
||||
return 0;
|
||||
|
@ -846,6 +844,38 @@ void Q_strcat( char *dest, int size, const char *src ) {
|
|||
Q_strncpyz( dest + l1, src, size - l1 );
|
||||
}
|
||||
|
||||
/*
|
||||
* Find the first occurrence of find in s.
|
||||
*/
|
||||
const char *Q_stristr( const char *s, const char *find)
|
||||
{
|
||||
char c, sc;
|
||||
size_t len;
|
||||
|
||||
if ((c = *find++) != 0)
|
||||
{
|
||||
if (c >= 'a' && c <= 'z')
|
||||
{
|
||||
c -= ('a' - 'A');
|
||||
}
|
||||
len = strlen(find);
|
||||
do
|
||||
{
|
||||
do
|
||||
{
|
||||
if ((sc = *s++) == 0)
|
||||
return NULL;
|
||||
if (sc >= 'a' && sc <= 'z')
|
||||
{
|
||||
sc -= ('a' - 'A');
|
||||
}
|
||||
} while (sc != c);
|
||||
} while (Q_stricmpn(s, find, len) != 0);
|
||||
s--;
|
||||
}
|
||||
return s;
|
||||
}
|
||||
|
||||
|
||||
int Q_PrintStrlen( const char *string ) {
|
||||
int len;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue