Skip to content
Snippets Groups Projects
Commit f8f7fcbe authored by rsc's avatar rsc
Browse files

handle EOF in shell

parent 349ee132
No related branches found
No related tags found
No related merge requests found
......@@ -42,12 +42,15 @@ main(void)
{
while(1){
puts("$ ");
memset(buf, '\0', sizeof(buf));
gets(buf, sizeof(buf));
memset(buf, 0, sizeof buf);
gets(buf, sizeof buf);
if(buf[0] == 0) // EOF
break;
if(parse(buf) < 0)
continue;
runcmd();
}
exit();
}
int
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment