4 * 18. Insertions from the standard input
7 r_rd(int argc, Rune **argv)
17 * print prompt, then read until double newline,
18 * then run the text just read as though it were
19 * a macro body, using the remaining arguments.
21 if(fd2path(0, buf, sizeof buf) >= 0 && strstr(buf, "/dev/cons")){
23 fprint(2, "%S", argv[1]);
25 fprint(2, "%c", 7/*BEL*/);
29 Binit(&bstdin, 0, OREAD);
33 while((s = Brdstr(&bstdin, '\n', 0)) != nil){
38 fmtprint(&fmt, "%s", s);
41 p = runefmtstrflush(&fmt);
43 warn("out of memory in %Crd", dot);
48 runmacro('.', argc, argv);
52 /* terminate exactly as if input had ended */
54 r_ex(int argc, Rune **argv)
66 addreq(L("rd"), r_rd, -1);
67 addreq(L("ex"), r_ex, 0);