• R/O
  • SSH
  • HTTPS

yash: 提交


Commit MetaInfo

修訂20 (tree)
時間2007-12-02 16:45:26
作者ywtnb

Log Message

directcommand

Change Summary

差異

--- yash/branches/newparser/yash.c (revision 19)
+++ yash/branches/newparser/yash.c (revision 20)
@@ -395,17 +395,14 @@
395395 init_env();
396396
397397 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);
409406 return laststatus;
410407 }
411408
Show on old repository browser