修訂 | 20 (tree) |
---|---|
時間 | 2007-12-02 16:45:26 |
作者 | ywtnb |
directcommand
@@ -395,17 +395,14 @@ | ||
395 | 395 | init_env(); |
396 | 396 | |
397 | 397 | if (directcommand) { |
398 | - //FIXME | |
399 | -// SCMD *scmds; | |
400 | -// ssize_t count; | |
401 | -// | |
402 | -// is_interactive = 0; | |
403 | -// count = parse_line(directcommand, &scmds); | |
404 | -// if (count < 0) | |
405 | -// return EXIT_SUCCESS; | |
406 | -// exec_list(scmds, count); | |
407 | -// scmdsfree(scmds, count); | |
408 | -// free(scmds); | |
398 | + directcommand = skipwhites(directcommand); | |
399 | + if (!*directcommand) return EXIT_SUCCESS; | |
400 | + | |
401 | + STATEMENT *statements = parse_all(directcommand, NULL); | |
402 | + | |
403 | + is_interactive = 0; | |
404 | + if (!statements) return 2; /* syntax error */ | |
405 | + exec_statements(statements); | |
409 | 406 | return laststatus; |
410 | 407 | } |
411 | 408 |