tier1/strtools.cpp
const char *V_GetFileExtension( const char *path )
{
	int len = V_strlen( path );
	if ( len <= 1 )
		return NULL;

	const char *src = path + len - 1;

	//
	// back up until a . or the start
	//
	while (src != path && *(src-1) != '.' )
		src--;

	// check to see if the '.' is part of a pathname
	if (src == path || PATHSEPARATOR( *src ) )
	{		
		return NULL;  // no extension
	}

	return src;
}
//-----------------------------------------------------------------------------
// Purpose: Returns a pointer to the file extension within a file name string
// Input:	in - file name 
// Output:	pointer to beginning of extension (after the "."), or NULL
//				if there is no extension
//-----------------------------------------------------------------------------
Returns a pointer to the file extension within a file name string
Input: in - file name
Output:        pointer to beginning of extension (after the "."), or NULL
if there is no extension
Returns a pointer to the file extension within a file name string Input : in - file name Output : pointer to beginning of extension ( after the " . " ) or NULL if there is no extension
const char *V_GetFileExtension( const char *path )
{
	int len = V_strlen( path );
	if ( len <= 1 )
		return NULL;
	const char *src = path + len - 1;
	 back up until a . or the start
	while (src != path && *(src-1) != '.' )
		src--;
	 check to see if the '.' is part of a pathname
	if (src == path || PATHSEPARATOR( *src ) )
	{		
		return NULL;   no extension
	}
	return src;
}
const char * V_GetFileExtension ( const char * path ) { int len = V_strlen ( path ) ; if ( len <= 1 ) return NULL ; const char * src = path + len - 1 ; while ( src != path && * ( src - 1 ) != ' ' ) src -- ; if ( src == path || PATHSEPARATOR ( * src ) ) { return NULL ; } return src ; }
Purpose: Returns a pointer to the file extension within a file name string
Input: in - file name
Output:        pointer to beginning of extension (after the ".
Purpose : Returns a pointer to the file extension within a file name string Input : in - file name Output : pointer to beginning of extension ( after the " .
// // back up until a . or the start // // check to see if the '.' is part of a pathname // no extension