@@ -314,7 +314,6 @@ STATIC int usage(char **argv) {
314314
315315 return 1 ;
316316}
317- #if 0
318317// Process options which set interpreter init options
319318STATIC void pre_process_options (int argc , char * * argv ) {
320319 for (int a = 1 ; a < argc ; a ++ ) {
@@ -364,7 +363,6 @@ STATIC void pre_process_options(int argc, char **argv) {
364363 }
365364 }
366365}
367- #endif
368366
369367STATIC void set_sys_argv (char * argv [], int argc , int start_arg ) {
370368 for (int i = start_arg ; i < argc ; i ++ ) {
@@ -389,14 +387,14 @@ int main(int argc, char **argv) {
389387 // For this, actual main (renamed main_) should not be inlined into
390388 // this function. main_() itself may have other functions inlined (with
391389 // their own stack variables), that's why we need this main/main_ split.
392- // mp_stack_ctrl_init();
390+ mp_stack_ctrl_init ();
393391 return main_ (argc , argv );
394392}
395393
396394MP_NOINLINE int main_ (int argc , char * * argv ) {
397- // mp_stack_set_limit(40000 * (BYTES_PER_WORD / 4));
395+ mp_stack_set_limit (40000 * (BYTES_PER_WORD / 4 ));
398396
399- // pre_process_options(argc, argv);
397+ pre_process_options (argc , argv );
400398
401399#if MICROPY_ENABLE_GC
402400 char * heap = malloc (heap_size );
@@ -408,7 +406,6 @@ MP_NOINLINE int main_(int argc, char **argv) {
408406 // create keyboard interrupt object
409407 MP_STATE_VM (keyboard_interrupt_obj ) = mp_obj_new_exception (& mp_type_KeyboardInterrupt );
410408
411- char * home = getenv ("HOME" );
412409 char * path = getenv ("MICROPYPATH" );
413410 if (path == NULL ) {
414411 #ifdef MICROPY_PY_SYS_PATH_DEFAULT
@@ -435,15 +432,7 @@ MP_NOINLINE int main_(int argc, char **argv) {
435432 if (p1 == NULL ) {
436433 p1 = p + strlen (p );
437434 }
438- if (p [0 ] == '~' && p [1 ] == '/' && home != NULL ) {
439- // Expand standalone ~ to $HOME
440- CHECKBUF (buf , PATH_MAX );
441- CHECKBUF_APPEND (buf , home , strlen (home ));
442- CHECKBUF_APPEND (buf , p + 1 , (size_t )(p1 - p - 1 ));
443- path_items [i ] = MP_OBJ_NEW_QSTR (qstr_from_strn (buf , CHECKBUF_LEN (buf )));
444- } else {
445- path_items [i ] = MP_OBJ_NEW_QSTR (qstr_from_strn (p , p1 - p ));
446- }
435+ path_items [i ] = MP_OBJ_NEW_QSTR (qstr_from_strn (p , p1 - p ));
447436 p = p1 + 1 ;
448437 }
449438 }
0 commit comments