mirror of
https://github.com/elua/elua.git
synced 2025-01-08 20:56:17 +08:00
suppress 'Unable to initialize the eLua shell' message when BUILD_SHELL is not defined
This commit is contained in:
parent
81e7f040fc
commit
c5104e73cb
26
src/main.c
26
src/main.c
@ -29,12 +29,12 @@
|
||||
// in the order you want eLua to search for them
|
||||
char *boot_order[] = {
|
||||
#if defined(BUILD_MMCFS)
|
||||
"/mmc/autorun.lua",
|
||||
"/mmc/autorun.lc",
|
||||
"/mmc/autorun.lua",
|
||||
"/mmc/autorun.lc",
|
||||
#endif
|
||||
#if defined(BUILD_ROMFS)
|
||||
"/rom/autorun.lua",
|
||||
"/rom/autorun.lc",
|
||||
"/rom/autorun.lua",
|
||||
"/rom/autorun.lc",
|
||||
#endif
|
||||
};
|
||||
|
||||
@ -103,14 +103,15 @@ int main( void )
|
||||
dm_register( remotefs_init() );
|
||||
|
||||
// Search for autorun files in the defined order and execute the 1st if found
|
||||
for( i = 0; i < sizeof( boot_order )/sizeof( *boot_order ); i++ ){
|
||||
if( ( fp = fopen( boot_order[i], "r" ) ) != NULL )
|
||||
{
|
||||
fclose( fp );
|
||||
char* lua_argv[] = { "lua", boot_order[i], NULL };
|
||||
lua_main( 2, lua_argv );
|
||||
break; // autoruns only the first found
|
||||
}
|
||||
for( i = 0; i < sizeof( boot_order ) / sizeof( *boot_order ); i++ )
|
||||
{
|
||||
if( ( fp = fopen( boot_order[ i ], "r" ) ) != NULL )
|
||||
{
|
||||
fclose( fp );
|
||||
char* lua_argv[] = { "lua", boot_order[i], NULL };
|
||||
lua_main( 2, lua_argv );
|
||||
break; // autoruns only the first found
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef ELUA_BOOT_RPC
|
||||
@ -120,7 +121,6 @@ int main( void )
|
||||
// Run the shell
|
||||
if( shell_init() == 0 )
|
||||
{
|
||||
printf( "Unable to initialize the eLua shell!\n" );
|
||||
// Start Lua directly
|
||||
char* lua_argv[] = { "lua", NULL };
|
||||
lua_main( 1, lua_argv );
|
||||
|
Loading…
x
Reference in New Issue
Block a user