manage strstr() use

This commit is contained in:
Garux 2020-01-24 02:47:33 +03:00
parent 325a46a102
commit 1f59dac119
6 changed files with 7 additions and 7 deletions

View File

@ -106,7 +106,7 @@ void ExpandWildcards( int *argc, char ***argv ){
{
path = ( *argv )[i];
if ( path[0] == '-'
|| ( !strstr( path, "*" ) && !strstr( path, "?" ) ) ) {
|| ( !strchr( path, '*' ) && !strchr( path, '?' ) ) ) {
ex_argv[ex_argc++] = path;
continue;
}

View File

@ -110,7 +110,7 @@ const char *FindFrameFile( const char *frame ){
char suffix[32];
const char *s;
if ( strstr( frame, "." ) ) {
if ( strchr( frame, '.' ) ) {
return frame; // allready in dot format
}

View File

@ -84,7 +84,7 @@ polyset_t *Polyset_LoadSets( const char *file, int *numpolysets, int maxTrisPerS
//
// load the frame
//
if ( strstr( file, ".3DS" ) || strstr( file, ".3ds" ) ) {
if ( striEqual( path_get_filename_base_end( file ), ".3ds" ) ) {
_3DS_LoadPolysets( file, &psets, numpolysets, g_verbose );
}
else{

View File

@ -577,7 +577,7 @@ int main( int argc, char **argv ){
}
else if ( !strcmp( argv[i], "-dump" ) ) {
printf( "Dumping contents of: '%s'\n", argv[i + 1] );
if ( strstr( argv[i + 1], ".md3" ) ) {
if ( striEqual( path_get_filename_base_end( argv[i + 1] ), ".md3" ) ) {
MD3_Dump( argv[i + 1] );
}
else

View File

@ -1661,7 +1661,7 @@ void LoadEntityIndexMap( entity_t *e ){
/* get each value */
for ( i = 0; i < 256 && !strEmpty( search ); i++ )
{
space = strstr( search, " " );
space = strchr( search, ' ' );
if ( space != NULL ) {
strClear( space );
}

View File

@ -524,7 +524,7 @@ shaderInfo_t *CustomShader( shaderInfo_t *si, char *find, char *replace ){
}
/* do some bad find-replace */
s = strstr( srcShaderText, find );
s = strIstr( srcShaderText, find );
if ( s == NULL ) {
//% strcpy( shaderText, srcShaderText );
return si; /* testing just using the existing shader if this fails */
@ -998,7 +998,7 @@ static void ParseShaderFile( const char *filename ){
strcpy( si->shader, token );
/* ignore ":q3map" suffix */
suffix = strstr( si->shader, ":q3map" );
suffix = strIstr( si->shader, ":q3map" );
if ( suffix != NULL ) {
strClear( suffix );
}