#include "rc.h" int prompt(ushort *flag) { int fd, f = *flag; if(f){ if(!readline(shell.prompt)){ runner->flag.eof = 1; return 0; } fd = mapfd(0); write(fd, "\n\r", 2); shell.prompt = "> "; // NOTE: can't use tab here: we have a hacky prompt length computation runner->line++; *flag = 0; } return 1; }