1 #define MAX_ARGS 80 2 #define ARGSIZE 256 3 4 static int cmd_argc; 5 static char cmd_argv[ MAX_ARGS ][ ARGSIZE ]; 6 7 void Cmd_Init( const char *text ) 8 { 9 char *p; 10 11 cmd_argc = 0; 12 13 while ( cmd_argc < MAX_ARGS ) 14 { 15 while ( *text && isspace( *text ) ) 16 { 17 text++; 18 } 19 20 if ( !*text || *text == ' ' ) 21 break; 22 23 if ( *text == '"' ) 24 { 25 text++; 26 p = ( char * )&cmd_argv[ cmd_argc++ ]; 27 28 while ( *text && *text != '"' ) 29 { 30 *p++ = *text++; 31 } 32 33 *p = '