MCPcopy Create free account
hub / github.com/dhewm/dhewm3 / Exec_f

Method Exec_f

neo/framework/CmdSystem.cpp:230–251  ·  view source on GitHub ↗

=============== idCmdSystemLocal::Exec_f =============== */

Source from the content-addressed store, hash-verified

228===============
229*/
230void idCmdSystemLocal::Exec_f( const idCmdArgs &args ) {
231 char * f;
232 idStr filename;
233
234 if ( args.Argc () != 2 ) {
235 common->Printf( "exec <filename> : execute a script file\n" );
236 return;
237 }
238
239 filename = args.Argv(1);
240 filename.DefaultFileExtension( ".cfg" );
241 fileSystem->ReadFile( filename, reinterpret_cast<void **>(&f), NULL );
242 if ( !f ) {
243 common->Printf( "couldn't exec %s\n", args.Argv(1) );
244 return;
245 }
246 common->Printf( "execing %s\n", args.Argv(1) );
247
248 cmdSystemLocal.BufferCommandText( CMD_EXEC_INSERT, f );
249
250 fileSystem->FreeFile( f );
251}
252
253/*
254===============

Callers

nothing calls this directly

Calls 6

ArgcMethod · 0.80
ArgvMethod · 0.80
ReadFileMethod · 0.80
BufferCommandTextMethod · 0.80
FreeFileMethod · 0.80
PrintfMethod · 0.45

Tested by

no test coverage detected