flag = 0;/* assume no special flags for now */ if(len > 0) strcpy(lastcommand, console_buffer); elseif(len == 0) flag |= CMD_FLAG_REPEAT; // 命令从console_buffer搬运到lastcommand中, 乾坤大挪移 rc = run_command (lastcommand, flag);
/* OK - call function to do the command */ if((cmdtp->cmd)(cmdtp, flag, argc, argv)!= 0){ rc =-1; } repeatable &= cmdtp->repeatable; /* ctrl+c 会终止, Did the user stop this? */ if(had_ctrlc ()) return-1;/* if stopped then not repeatable */ }